Closes a connection to a server for CICS® as an HTTP client.
WEB CLOSE enables an application program to close a connection with a server. The session token identifies the connection that is to be closed. When the connection is closed, the session token that applies to it is no longer valid for use. The session token is required to receive a response from the server and to read the HTTP headers for the response, so the WEB CLOSE command should not be issued until all interaction with the server and with the response that it sends is complete. The command releases CICS resources involved with the connection.
The WEB CLOSE command does not cause CICS to notify the server that the connection should be terminated. It only makes CICS close the connection on the client side. On the final request that you make using the connection, you should specify the CLOSESTATUS(CLOSE) option on the WEB SEND or WEB CONVERSE command. When this option is specified, CICS writes a Connection: close header on the request, or, for a server at HTTP/1.0 level, omits the Connection: Keep-Alive header. The information in the headers means that the server can close its connection with you immediately after sending the final response, rather than waiting to see if you send further requests before timing out.
The connection might also be closed at the request of the server before the WEB CLOSE command is issued. If you need to test whether the server has requested termination of the connection, use the WEB READ HTTPHEADER command to look for the Connection: close header in the last message from the server.
If the WEB CLOSE command is not issued by the application program, then at end of task CICS clears the data relating to the connection and closes the connection, if it has not already been closed.