HTTP requests include a method, which is a keyword explaining the action that the client wants the server to perform for the material included in the request. CICS® Web support implements all the standard request methods defined by the HTTP/1.1 specification, and some additional methods that were accepted in earlier CICS releases.
The tables in this reference list the circumstances in which each method may be used. Consult the HTTP specification to which you are working, for more detailed guidance about the methods mentioned in this reference.
Table 1 shows the actions that CICS takes for request methods, and the actions suggested for a user application program. It is important to check the HTTP specification to which you are working, for detailed guidance and any relevant requirements.
Method | CICS action with HTTP/1.0 client | CICS action with HTTP/1.1 client | Message body appropriate on request? | Suitable action by user application program |
---|---|---|---|---|
GET (Request for resource) | Accepted. Request passed to application. | Accepted. Request passed to application. | No | Send resource to the Web client, or send an error response explaining why you cannot do this. |
HEAD (Request for response headers) | Accepted. Request passed to application. | Accepted. Request passed to application. | No | Send resource to the Web client exactly as if responding to a GET request for the same resource. CICS removes response body to leave only headers. |
POST (Send input data) | Accepted. Request passed to application. | Accepted. Request passed to application. | Yes | Support for method is optional. Extract data (which might be form fields), process it and send a response to the Web client. May also be used for changing or creating a resource, in which case handle as for a PUT request. |
PUT (Send new item) | Accepted. Request passed to application. | Accepted. Request passed to application. | Yes | Support for method is optional. If request is valid,
create a resource with the specified URL using the content of the message,
or replace your existing resource with the content of the message, as appropriate.
Send an acknowledgement to the Web client. The HTTP/1.1 specification has
detailed requirements for correct operation. Tip: This request
type is unlikely to be applicable for your CICS Web support implementation. If wanted,
it could be fulfilled by creating a URIMAP definition for the specified URL,
and storing the resource to be provided as a static response.
|
TRACE (See request's path and final state) | Rejected with status code 501 Not Implemented. No user application called. | Accepted. CICS responds. No user application called. | No | Not passed to user application. CICS returns response containing request with original headers plus any headers it acquired (such as the Via header). |
OPTIONS (Request for information about server) | Rejected with status code 501 Not Implemented. No user application called. | OPTIONS * accepted (others rejected with 501). CICS responds. No user application called. | No purpose defined for it at present. | Not passed to user application. CICS returns response with basic information (the HTTP version and server software description). |
DELETE (Delete resource) | Accepted. Request passed to application. | Accepted. Request passed to application. | No | Support for method is optional. If request is valid, delete your existing resource, and send an acknowledgement to the Web client. |
LINK, UNLINK, REQUEUE | Accepted. Request passed to application. | Rejected with status code 501 Not Implemented. No user application called. | Undefined | Not described in standard HTTP specifications. Handle as you did in earlier CICS releases. Do not use in new CICS Web support applications. |
Table 2 lists the request methods supported by the CICS API for HTTP client requests, and summarizes the correct use of the methods. For guidance on the correct use of each method, and any requirements that apply to an HTTP client using the method, check the HTTP specification to which you are working.
Method | Send to HTTP/1.0 server? | Send to HTTP/1.1 server? | Message body on request? | Purpose |
---|---|---|---|---|
GET (Request for resource) | Yes | Yes | No | Obtain a resource from the server. |
HEAD (Request for response headers) | Yes | Yes | No | Obtain the headers for a resource from the server. Enables you to check on the nature, status or size of the resource without having to retrieve the whole body. |
POST (Send input data) | Yes | Yes | Yes | Send data to a server. For example, form data might be sent in this way. Servers are not required to support this method. |
PUT (Send new item) | Might not be supported by server. | Yes | Yes | Create or modify a resource on the server. The URL for your request is the URL that the resource has on the server. The request can be used to update an existing item or to create a new item. Servers are not required to support this method. |
TRACE (See request's path and final state) | Might not be supported by server. | Yes | No | Obtain a response showing the final state of your request and the path it took to the server (shown in the Via header). You can see what proxy servers are being used to handle your request. Servers are not required to support this method. |
OPTIONS (Request for information about server) | Might not be supported by server. | Yes | Allowed, but no purpose defined for it at present. | Obtain information about the server. Apply the request
to the whole server by specifying * (asterisk) as the request path, or specify
a full request path to get information about that resource. Servers are not
required to support this method. Tip: CICS performs this request automatically
when the WEB OPEN command is issued, and the HTTP version of the server is
returned on the WEB OPEN command.
|
DELETE (Delete resource) | Might not be supported by server. | Yes | No | Delete a resource on the server. The request URL is the URL of the item to be deleted. Servers are not required to support this method. |
LINK, UNLINK, REQUEUE, and extension methods generally | Not permitted. INVREQ response returned and request not sent. | Not permitted. INVREQ response returned and request not sent. | Undefined | Not available on WEB API for CICS as an HTTP client. |