Writing HTTP headers for a response
For dynamic responses created by application programs, CICS® automatically provides the HTTP headers that are required for basic messages, depending on the HTTP protocol version used for the message. Your application does not need to write these headers. However, you might want to add further HTTP headers to your response.
About this task
Here is the full list of headers created by CICS:
- ARM correlator
- Connection
- Content-Type (written by CICS, but can be supplied by a client application if a complex header is required)
- Content-Length
- Date
- Expect
- Host
- Server (automatic creation depends on system initialization parameter HTTPSERVERHDR. See The HTTPSERVERHDR system initialization parameter.)
- TE (written by CICS but further instances may be added)
- Transfer-Encoding
- User-Agent (automatic creation depends on system initialization parameter HTTPUSRAGENTHDR. See The HTTPUSRAGENTHDR system initialization parameter.)
- WWW-Authenticate
The headers
that CICS provides when a response is sent are the
ones that are typically written to make a basic message comply with
the appropriate HTTP protocol specification. You might want to add
further HTTP headers to the response for some purposes:
- Control of caching and document expiry; for example, Cache-Control, Expires, Last-Modified.
- Content negotiation; for example, Accept-Ranges, Vary.
- Information for the web client; for example, Title, Warning, further Content headers.
Write additional HTTP headers for a message before you issue the WEB SEND command to send the message. The exception to this rule is when you write headers to be sent as trailing headers on a chunked message, in which case the subsequent procedure applies. To write HTTP headers for a response: