Developing HTTP applications

In CICS®, web-aware application programs use EXEC CICS WEB commands to interact with a web client or a server through CICS. For CICS as an HTTP server, these programs can receive and analyze HTTP requests and provide application-generated responses to the web client.

Before you begin

Before you start to code web-aware application programs for CICS as an HTTP server, read HTTP request and response processing for CICS as an HTTP server so that you understand the process.

If you want the service you are providing to web clients to comply with the HTTP protocol specifications, in particular HTTP/1.1, read HTTP/1.1 compliance for CICS as an HTTP server for more information about the actions that CICS and your user application can take.

About this task

For each HTTP request that requires an application-generated response, CICS calls the web-aware application program that is specified on the URIMAP definition for the request, or by the analyzer program if an analyzer is used. If you use a URIMAP definition to specify the application program, you can select a single application program to service all requests using a particular URL. If you are using an analyzer program either instead of, or in addition to, the URIMAP definition, it can analyze the request and decide on an alternative application program.
Remember: web-aware application programs that use the EXEC CICS WEB commands must run in the CICS region where the web client's request is received. However, they can link to application programs in other CICS regions; for example, to perform business logic.

For CICS as an HTTP server, when an application program has sent a response to a request and returned control to CICS, it does not wait for further requests from the web client, even when requests form a logical sequence, or are made using a persistent connection, or are pipelined. If you need to share information between different programs (or new instances of the same program) across a series of requests and responses, you can do so using CICS-managed resources or using elements of the requests sent by the web client.

When EXEC CICS WEB commands are used for CICS as an HTTP server, they do not have the SESSTOKEN option. The SESSTOKEN option indicates that a command is being used for CICS as an HTTP client.

You can execute the business logic for the request processing, using the information you have gathered. You might want to involve other application programs to perform processing. A web-aware application program can produce a response to the HTTP request based on information that it receives from non-web-aware programs. You are advised to separate the business logic from the presentation logic. In a web-aware application, presentation logic controls the interaction with the web client. For more information, see Separating business and presentation logic .

You can code web-aware application programs to process an HTTP request by following the guidance in the subtopics.