Handling DELETE requests for Atom collections
When a web client makes a DELETE request for an Atom collection, your service routine must delete the entry and indicate whether or not the request was successful.
Procedure
- Use the EXEC CICS GET CONTAINER command to retrieve the data in the DFHATOMPARMS container, which contains information about the request. The sample service routine DFH$W2S1 shows you how to do this. DFHATOMPARMS container describes all the parameters that CICS passes in this container.
- Check the value of the ATMP_HTTPMETH parameter to identify the request method. CICS returns an error or makes an appropriate response for methods other than GET, POST, PUT, and DELETE.
- Use the ATMP_SELECTOR parameter to select, from the resource that holds the data for your Atom entries, the record that contains the data for the Atom entry which the client wants to delete.
- Delete the record in your resource that corresponds to the selector value in the ATMP_SELECTOR parameter, and use the ATMP_RESPONSE parameter in the DFHATOMPARMS container to return a response code of zero. CICS ignores the remaining parameters in the DFHATOMPARMS container, so you do not need to make any changes to these. CICS sends a response to the client with the status code 200, indicating successful completion of the request.
- If you do not carry out the request, return an alternative response code in the ATMP_RESPONSE parameter. DFHATOMPARMS container lists the response codes that you can use and the HTTP error response that CICS sends in each case.