Writing HTTP headers for a request

For client HTTP requests, CICS® automatically provides the HTTP headers that are required for basic messages, depending on the HTTP protocol version used for the message. You might need to add further HTTP headers to your request.

Some HTTP headers are created automatically by CICS if the message requires them. The full list of headers created by CICS is:
  • Connection
  • Content-Length
  • Start of changeContent-Type (written by CICS, but can be supplied by a client application if a complex header is required)End of change
  • Date
  • Expect
  • Host
  • Server
  • TE (written by CICS, but the application can add further instances)
  • Transfer-Encoding
  • User-Agent
  • WWW-Authenticate
Some of these headers are appropriate only for CICS as an HTTP server. The circumstances in which these headers are created are described in HTTP header reference for CICS Web support. CICS does not allow you to write your own versions of CICS-supplied request headers, Start of changeexcept for the Content-Type and TE headersEnd of change.
The headers that CICS provides for a request are the ones that should normally be written for a basic HTTP/1.1 message to be compliant with the HTTP/1.1 specification. (CICS sends your request with HTTP/1.1 given as the HTTP version.) You might want to add further HTTP headers for purposes such as:
  • Stating preferences to the server (for example, Accept-Encoding, Accept-Language)
  • Making a conditional request (for example, If-Match, If-Modified-Since)
  • Providing basic authentication information to a server or proxy (Authorization, Proxy-Authorization)
Check the HTTP specification to which you are working for requirements relating to any additional HTTP headers that you decide to use for your message. See The HTTP protocol for more information about the HTTP specifications.

Write additional HTTP headers for a message before you issue the WEB SEND command to send the message. The exception to this rule is if you are writing headers to be sent as trailing headers on a chunked message, in which case the special process mentioned below applies. When writing HTTP headers for a request: