Open topic with navigation
Adds the specified header to all subsequent HTTP requests.
int web_add_auto_header( const char *Header, const char *Content );
int object.add_auto_header( String Header, String Content );
This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure. Note that in many cases, this return value indicates the technical success of the function, and not the result. For example, a function that registers a string to be found in a subsequent step returns LR_PASS to indicate that the registration was successful. This does not indicate that the string was found in the server response.
The following argument(s) can be parameterized using standard parameterization: header, content.
The web_add_auto_header function is a service function that adds a header to all subsequent HTTP requests.
Web scripts automatically send standard headers with each HTTP request they submit. You can add additional headers using the web_add_auto_header function. This instructs VuGen to generate the specified header for all HTTP requests that follow. This is in contrast to the web_add_header function that applies only to the HTTP request that follows it.
The web_add_auto_header function is generated automatically when headers are required for two consecutive steps, provided that header generation is enabled in the Advanced tab of the Recording Options. Refer to the VuGen help, Setting Advanced Recording Options.
You can also add this function to your script manually.
To enable compression and decompression for browsers, set the Accept–Encoding option to gzip:
You can verify if the server sent compressed data, by searching for the string
"Content–Encoding: gzip" in the Execution log.
To cancel automatic header generation, use:
web_cleanup_auto_headers to stop all automatic header generation.
web_remove_auto_header to stop automatic header generation for a specific header.