SPDY Functions (spdy) > spdy_submit_data

spdy_submit_data

Performs an "unconditional" or "contextless" form submission.

C Language

int spdy_submit_data( const char *StepName, const char *Action, <List of Attributes>, ITEMDATA, <List of data>, [ EXTRARES, <List of Resource Attributes>,] LAST ); 
Argument
Description
StepName
The name of the step, as it appears in the graphical script.
Action
The HTTP address of the action to perform when submitting the data. The syntax is "Action=<urlAddress>"
Action: The ACTION attribute of the FORM element. The ACTION attribute specifies the address (URL) to be used to carry out the action of the form. You can also specify Action/sfx, which indicates to search the form using the suffix of the action.
List of Attributes

The following attributes are supported:

EncodeAtSign: Encode the "@" sign as in its ASCII representation. The possible values are Yes or No.

EncType: The encoding method used.

Method: The form submission method: POST or GET (default: POST)

Mode: The Recording Level: HTML or HTTP. Click Mode (Recording Level) for more information.

RecContentType: The format of the data to be returned. For example, text/html.

Referer: The URL of the referring Web page. The page that referred to the current page. If the location was explicitly expressed, this attribute is omitted.

Snapshot: The returned data.

SpdyPushCount: The number of files returned.

SpdyStreamID: The communications channel ID.

TargetFrame: The name of the frame containing the current link or resource. Click TargetFrame for more information.

UserAgent: Identifies a component other than the browser that will execute the step, for example, an ActiveX component running under the browser. This user agent header is sent for the requests made by the step. No check is made to confirm that the user agent argument matches the browser's User-Agent Run-Time Setting. Non-browser steps do not affect the emulated browser context, nor do they build a new context from the result.

ITEMDATA
A marker that separates between the attributes and the list of data fields.
List of Data
The list of data fields used to define the form submission. Because the request is contextless, the list of data fields includes all hidden fields. The rules of data encoding for submission of forms apply. For a list of the possible entries in the list, see web_submit_data.
The value fields can be encrypted or plain, for example:
"name=n1", "value=v1", ENDITEM,
"name=n2", "EncryptedValue=qwerty", ENDITEM,
name: The name attribute within an INPUT element of the field. It is the name of the field as it appears on the Web page.
EXTRARES
A demarcation parameter indicating that the next parameter will be a list of resource attributes.
List of Resource Attributes
LAST
A marker that indicates the end of the field list.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

Parameterization

The following argument(s) can be parameterized using standard parameterization: Action, Method, List of Data Fields

General Information

The spdy_submit_data function is an Action Functions that performs an "unconditional" or "context-less" form submission. (Each action function in a script causes the browser to display a new Web page or frame. All action functions can be recorded by VuGen.) This function allows you to generate GET and POST requests as made by the HTML forms. You do not need to have a form context to execute this request.

spdy_submit_data is recorded only when VuGen is in either the URL–based recording mode, or in the HTML–based recording mode with the A script containing explicit URLs only option checked (see VuGen's Recording Options).

The method indicates how the data of the form is sent to the server, whether as a query within the URL (GET), or as a request body (POST).

This function is generated when VuGen is set to record a session in HTTP (all requests from the server) recording mode. VuGen also records a spdy_submit_data statement whenever a form is submitted.

Examples of non–HTML–generated resources are .gif and .jpg images. The List of Resource Attributes is only inserted when the recording option for these resources is set at Record within the current script step. This is the default setting. See the Virtual User Generator User Guide.

The HTTP header can be modified to pass additional information about the request to the server. Using HTTP headers you can, for example, allow other content types in the response such as compressed files, or you can request a Web page only on certain conditions. To modify the HTTP header in the request, use web_add_header. To modify all subsequent requests, use web_add_auto_header.

The EncType attribute specifies a Content Type to be specified as the value of the "Content–Type" request header. It indicates the encoding type (either URL–encoding or multi–part) to be used for generating an HTTP request from other arguments. The allowed specifications are:

If EncType is omitted and "Method=POST", "application/x–www–form–urlencoded" is used. If Method is not POST, no "Content–Type" request header is generated.

This function is supported for all Web scripts.