Support for Non-JSON Responses

The external REST service supports any arbitrary payload (currently in stringified format). If the response is anything other than JSON, a JSON message object is returned:

  • For text-compatible (non-JSON) content, Identity Cloud returns a JSON object similar to the following:

    {
        "headers": { "Content-Type": ["..."] },
        "body": "..."
    }   
  • Content that is not text-compatible (such as JPEGs) is base64-encoded in the response body and returned as follows:

    {
        "headers": { "Content-Type": ["..."] },
        "body": "...",
        "base64": true
    }   

Note

If the response format is JSON, the raw JSON response is returned. If you want to inspect the response headers, set forceWrap to true in your request. This setting returns a JSON message object with headers and body, similar to the object returned for text-compatible content.

Read a different version of :