Examining the request line for an HTTP request

CICS® stores the request line used for each HTTP request, for the application program to access if needed. An application program can use the WEB EXTRACT command to extract components of the request URL (including the path, host name, port number, and query string), the method used for the request, or the HTTP version of the request. Non-HTTP requests can also be identified in this way.

About this task

For information about the items in a request line, see The HTTP protocol . The request URL is a major element of the request line. The components of a URL explains the different parts of a URL. Your application program might examine any of the items in the request line so that it can process the request and provide an appropriate response. Here are some common reasons for extracting information from a request line:
  • To ensure that the same application program is called to handle a number of different requests, perhaps as part of a logical request sequence, or as different requests that relate to the same resource.
  • To see what action is being requested from the application by the HTTP method. HTTP method reference for CICS web support explains the different methods that a web client might use for a request, and suggests action that is appropriate in each case.
  • To use the path component of the URL, which identifies the resource to which the request applies. In addition to being used to map the request to the handling application, you can design the path component of the URL to provide processing information to the application. For example, the path component can specify a particular function provided by the application. Or, if the web-aware application is providing a front end for more than one other application, the path component of the URL can identify the application to which the request applies. URLs for CICS Web support explains how this can be achieved.
  • To obtain a query string for processing by the application.
  • To identify the HTTP version for the web client, so that the application can provide an appropriate response. The HTTP version used by the web client can affect the HTTP headers, status code, and message content for the response. HTTP/1.0 clients might not handle the more advanced features described in the HTTP/1.1 specification.
  • To identify a non-HTTP request. CICS web support and non-HTTP requests has more information about handling non-HTTP requests.
See WEB EXTRACT full reference information about the options. Use the WEB EXTRACT command to obtain the following items:

Procedure



dfhtl_appsweb_urlexamine.html | Timestamp icon Last updated: Monday, 5 June 2017