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.

About this task

These HTTP headers are created automatically by CICS if the message requires them:
  • 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
  • TE (written by CICS but further instances may be added)
  • 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. You cannot write your own versions of CICS-supplied request headers, except for the Content-Type and TE headers.
Typically, the headers that CICS provides for a request are written for a basic HTTP/1.1 message, to comply 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 these:
  • 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. Refer to The HTTP protocol.

Write additional HTTP headers for a message before you issue the WEB SEND command to send the message. However, if you are writing headers to be sent as trailing headers on a chunked message, the following procedure applies. Note these points:


dfhtl_outmaking_headers.html | Timestamp icon Last updated: Thursday, 27 June 2019