|
Messages using chunked transfer-coding can be sent and received by XCICS.
XCICS as an HTTP server can receive a chunked message as a request, or send one as a response. XCICS as an HTTP client can send a chunked message as a request, or receive one as a response. XCICS Web support handles these different cases as follows:
| • | When XCICS as an HTTP server receives a chunked message as an HTTP request, XCICS Web support recognizes the chunked encoding. It waits until all the chunks are received (indicated by the receipt of a chunk with zero length), and assembles the chunks to form a complete message. The assembled message body can be received by a user application program using the WEB RECEIVE command. |
| • | You can limit the total amount of data that XCICS accepts for a single chunked message, using the MAXDATALEN option on the
TCPIPSERVICE resource definition that relates to the port on which the request arrives. |
| • | Trailing headers from the chunked message can be read using the HTTP header commands. The Trailer header identifies the names of the headers that were present as trailing headers. If you are using an analyzer program in the processing path for the request, note that trailing headers are not passed to the analyzer program along with the main request headers. |
| • | When XCICS as an HTTP client receives a chunked message as a response to an application program's request, the chunks are also assembled before being passed to the application program as an entity body, and any trailing headers can be read using the HTTP header commands. You can specify how long the application will wait to receive the response, using the RTIMOUT attribute of the transaction profile definition for the transaction ID that relates to the application program. |
| • | When XCICS sends a chunked message, either as an HTTP server (response) or as an HTTP client (request), the application program can specify chunked transfer-coding by using the CHUNKING(CHUNKYES) option on the WEB SEND command for each chunk of the message. The message can be divided up in whatever way is most convenient for the application program. XCICS sends each chunk of the message, adding appropriate HTTP headers to indicate to the recipient that chunked transfer-coding is being used. The application program issues WEB SEND with CHUNKING(CHUNKEND), to indicate the end of the message. XCICS then sends an empty chunk (containing a blank line) to end the chunked message, along with any trailing headers that are wanted. |
|