HTTP headers
When an HTTPInput or HTTPRequest node receives a message, it parses the HTTP headers to create elements in the message tree. When an HTTPReply or HTTPRequest node sends a message, it parses the HTTP headers from the message tree into a bit stream.
The HTTP headers in a message depend on the type of message that is processed. There are four message types recognized in a message flow, and a parser is associated with each of these.
- Input. An input message is received by the HTTPInput node from a client.
The HTTP headers in the input message (data up to and including the
CRLFCRLF) are parsed by the HTTPInput parser and are included in the
message tree under the correlation name HTTPInput. The headers shown
in the following table are expected in an input message; others might
also be present.
Header Content Example Host The host name to which the client issued the message. localhost Content-Length The length of the body of the input message in decimal (that follows the CRLFCRLF after the last header). 520 Content-Type The type of the body data. text/xml; charset=utf-8 SOAPAction "" (empty string) The headers in the following table might also be automatically generated by the HTTPInput node depending on the request.
Header Content Example X-Original-HTTP-Command An expanded version of the original inbound request POST http://localhost:7800/Wss001/
services/Wss001 HTTP/1.1X-Remote-Addr The IP address of the client (or proxy if the client is connecting through a proxy) 127.0.0.1 X-Remote-Host The host name or address of the client (or proxy if the client is connecting through a proxy) localhost X-Server-Name The integration node's machine name localhost X-Server-Port The integration node's port 7800 X-Query-String The query string if present in the inbound URL (optional) a=b&x=y X-Scheme The scheme through which the client is connected, either http or https http - Reply.
A reply message is sent by the HTTPReply node to the client
that sent the corresponding input message. The headers in the reply
message are created in the message tree under the correlation name
HTTPReply, which is also the name of the parser used to parse that
part of the message tree to a bit stream. You can create your own
HTTPReply header in a Compute node,
or you can configure the HTTPReply node
to create it by using default values, or values taken from the HTTPReply
or HTTPResponse trees in the input message, or both.
You can set the HTTPReply Status Code in the local environment; for more information, see the instructions for setting the HTTP Status Code for a reply in Working with HTTP flows.
If the HTTPReply node creates a default HTTPReply header, it contains the headers and values shown in the following table.
Header Value Content-Length (if present in the input message) The calculated length of the reply message body in decimal. Content-Type text/xml; charset=ccsid of the message body - Request. A request message is sent by the HTTPRequest node. The HTTP
headers in this message must be created in the message tree under
the correlation name HTTPRequest, and are parsed by the HTTPRequest
parser when the message tree is parsed to a bit stream. You can create
your own HTTPRequest header in a Compute node, or you can configure
the HTTPRequest node to
create it using default values, or values taken from the HTTPInput
or HTTPRequest trees in the input message, or both. If the HTTPRequest node creates a
default HTTPRequest header, it contains the headers and values shown
in the following table.
Header Value Host Value set in the Default Web Service URL property. Content-Length The calculated length of the request message body in decimal. Content-Type text/xml; charset=ccsid of the message body SOAPAction "" (empty string) Content-Encoding "gzip" or "deflate" if the Use compression property is set to gzip, zlib (deflate), or deflate. Accept-Encoding "gzip, deflate" if the Accept compressed responses by default property is selected. - Response. A response message is received by the HTTPRequest node from the application to which the corresponding request message
was sent. The HTTP headers in the response message (data up to and
including the CRLFCRLF) are parsed by the HTTPResponse parser and
are included in the message tree under the correlation name HTTPResponse.
The header shown in the following table is expected in a response
message (though not required); others might also be present.
Header Content Example Content-Length The length of the response message body in decimal. 1585
Web services example messages provides example messages that include these headers.