WEB READ HTTPHEADER

Extract HTTP header information.

Read syntax diagramSkip visual syntax diagram
WEB READ HTTPHEADER

>>-WEB--READ--HTTPHEADER(data-area)--NAMELENGTH(data-value)----->

>--+----------------------+--VALUE(data-area)------------------->
   '-SESSTOKEN(data-area)-'                     

>--VALUELENGTH(data-area)--------------------------------------><

Conditions: INVREQ, LENGERR, NOTFND

This command is threadsafe.

 

Description

Start of changeWEB READ HTTPHEADER enables an application to extract HTTP header information from a message. When CICS is an HTTP server, the message is a request from a Web client. When CICS is an HTTP client, the message is a response from a server, and the SESSTOKEN option is specified.End of change

The CICS Internet Guide lists HTTP/1.1 headers that you are likely to receive, and gives guidance for the actions that you might take in response to them.

The HTTP header browsing commands (WEB STARTBROWSE HTTPHEADER, WEB READNEXT HTTPHEADER, WEB ENDBROWSE HTTPHEADER) can be used to browse through all the HTTP header information for a message.

Options

HTTPHEADER(data-area)
specifies the name of the HTTP header to be extracted.
NAMELENGTH(data-value)
specifies the length, as a fullword binary value, of the HTTP header name.
Start of changeSESSTOKEN(data-value)End of change
Start of change For CICS as an HTTP client, this option is required. It specifies the session token, an 8-byte binary value that uniquely identifies a connection between CICS and a server. This value is returned by a WEB OPEN command for CICS as an HTTP client. "Session tokens" in the CICS Internet Guide explains the use of the session token. End of change
VALUE(data-area)
specifies the buffer to contain the value of the HTTP header being extracted.
VALUELENGTH(data-area)
specifies the length of the buffer supplied on the VALUE option, as a fullword binary variable, and is set to the actual length of the data returned to the application. If the data exceeds the buffer length, a LENGERR condition is raised and the data is truncated.

Conditions

INVREQ
RESP2 values are:
1
The command is being issued in a non-CICS Web support application.
3
The command is being issued for a non-HTTP request.
Start of change43End of change
Start of changeNo HTTP headers found.End of change
LENGERR
RESP2 values are:
1
The length in VALUELENGTH is not greater than zero (CICS as an HTTP server).
2
The header value has been truncated because the receiving buffer is too small (CICS as an HTTP server).
Start of change35End of change
Start of changeThe length in NAMELENGTH is not greater than zero (CICS as an HTTP client).End of change
Start of change52End of change
Start of changeThe header value has been truncated because the receiving buffer is too small (CICS as an HTTP client).End of change
Start of change55End of change
Start of changeThe length in VALUELENGTH is not greater than zero (CICS as an HTTP client).End of change
NOTFND
RESP2 value is:
1
The header with the given name could not be found.
Start of changeNOTOPENEnd of change
Start of changeRESP2 value is:
27
Invalid session token.
End of change