Converter programs: Constructing an HTTP response

Top  Previous  Next

The size and contents of the HTTP response that you construct in the converter program are governed by:

The number and length of the HTTP headers that you want to include in the response.
The length and contents of the HTML data that you want to send in your response.

In turn, these will be governed by the design of the user-written application program and the information that it returned in its COMMAREA.

The response must contain an HTTP version, status code, status text, any HTTP headers that are required, and the message body. The format of the response should be compliant with the HTTP protocol specification to which you are working (HTTP/1.0 or HTTP/1.1).

XCICS inserts automatically some HTTP headers suitable for an HTTP/1.0 or HTTP/1.1 response.

When you use a converter program with XCICS Web support, you can:

Issue a GETMAIN command to obtain storage for the HTTP response.
Use storage acquired in an earlier stage of processing (such as the analyzer program) for the COMMAREA.
Construct the response in the COMMAREA returned by the application program.

The first word of the area used for the response must contain the length of the area (that is, the length of the HTTP response plus 4).