com.HTTPRequest.setHeader

Sets an HTTP header for the request.

Syntax

setHeader(
   name STRING,
   value STRING )
  1. name is the HTTP header name.
  2. value is the HTTP header value.

Usage

The setHeader() method defines an HTTP header with a name and value for the request.

If a header exists with the same name, it is replaced with the new value.

Setting a header after the body has been sent, or if a streaming operation has been started, will only be taken into account when a new request is reissued.

In case of error, the method throws an exception and sets the STATUS variable with the appropriate error number.