Handling HTTP headers
The HTTP client reads any number of metadata.http.headers.keyname variables from your event and puts them into the HTTP request. Similarly, any headers returned in the response are mapped to the same variables in the response. Some special handling is applied as described below.
All HTTP headers are converted from ISO-8859-1 (the character set for HTTP headers as defined in the RFC publications) to UTF-8 in the metadata (and vice versa for requests).
All HTTP header keys are converted to lowercase in both directions (since HTTP header keys are defined to be case-insensitive). You should use lowercase in all of your mapping and classification rules.
Any HTTP headers for which multiple values have been provided for a single key (after normalization of case) are dropped in either direction.
The following HTTP headers are handled specially in requests:
Field | Value | Description |
accept | from contentType | If not provided in the request, but contentType is set, this is set to the contents of metadata.contentType. |
accept-charset | utf-8 | Set to utf-8 if not set in the request. |
accept-encoding | * | Set to * if not set in the request. |
authorization | from configuration | Always overridden if the authentication type HTTP_BASIC is defined in the configuration. Otherwise, the value from the request metadata is used. |
connection | keep-alive | Always overridden. |
content-length | length of the payload | Always overridden. |
content-type | from contentType and charset | Set from contentType and charset if not set in the request. |
date | current date and time | Set to the current date and time if not set in the request. |
host | from configuration | Always overridden. |
user-agent | Apama/$VERSION ($PLATFORM $ARCH) | Set if not set in the request. |
The following HTTP header is handled specially in responses:
Field | Value | Description |
Content-Length | length of the payload | Always overridden. |
In addition, the top-level fields metadata.charset and metadata.contentType are set in the response from the HTTP content-type header.
Cookie and
Set-Cookie headers are handled specially. See
Dealing with cookies.