setCICSRestResponse

The system function serviceLib.setCICSRestResponse allows an EGL CICS REST Service to set a custom HTTP response depending on the business logic.

The invocation sets the REST HTTP response using the Record part CICSHttpResponse, which is provided for you and has the following fields:

body, type STRING?

The response body to be returned from the service;

  • body contains the value in JSON format as described in “REST for the developer.”
    • If body is not specified, then the value of body will be the function response in JSON format.
status, type INT
status contains the HTTP status code for the response. If status is not specified, then the value 200 is used.

Important status codes include 200 (OK) and 404 (Not Found). For a complete list, go to the website of the World Wide Web Consortium (http://www.w3.org/) and search for "HTTP status code."

statusMessage, type STRING
statusMessage contains the HTTP status message for the response. If statusMessage is not specified, then the value OK is used.

Important status messages include OK (code 200) and Not Found (code 404). For a complete list, go to the website of the World Wide Web Consortium (http://www.w3.org/) and search for "HTTP status code."