web_remove_auto_header
Stops scripts from adding a specific header to subsequent HTTP requests.
C Language
int web_remove_auto_header( const char *Header, char *Implicit, LAST );
Java Language
int object.remove_auto_header( String Header, String[] argumentList );
Argument | Description |
|---|---|
object | An expression evaluating to an object of type WebApi. Usually web for Java. See also
Function and Constant Prefixes. |
Header | The name of the user–defined header. Examples: Content–Type, If–Modified–Since, Referer, and User–Agent. |
Implicit | A flag indicating the handling of Implicit Headers. The possible values are Yes, No, and Cond in the following format: "ImplicitGen=Yes/No/Cond"Yes: Generate the implicit header as it was before any web_add _auto_header function was issued. No: Do not generate the specified header at all. Cond: Generate an implicit header only if this header was specified via a web_add _auto_header function. This is the default. |
LAST | A marker indicating the end of the argument list. |
Return Values
This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.
Parameterization
Parameterization is not applicable to this function.
General Information
The web_remove_auto_header function is a service function that stops adding a specific user–defined header to subsequent HTTP requests. This function cancels the automatic header generation for the specified header, initiated by web_add_auto_header.
The web_revert_auto_header function is equivalent to the web_remove_auto_header function with the ImplicitGen option set to Yes.
This function is supported for all web scripts.
C Example
The following example stops scripts from adding the Accept–Encoding header to subsequent HTTP requests. It continues to generate implicit headers.
web_add_auto_header("Accept–Encoding", "gzip");
...
web_remove_auto_header("Accept–Encoding", "ImplicitGen=Yes", LAST );
For Java:
lrapi.web.remove_auto_header("User–Agent",
new String[]{"ImplicitGen=Yes", "LAST"});Java Example
The following example stops scripts from adding the Accept–Encoding header to subsequent HTTP requests. It continues to generate implicit headers.
web.add_auto_header("Accept–Encoding", "gzip");
web.remove_auto_header("User–Agent",
new String[]{"ImplicitGen=Yes", "LAST"});

