Skip to content

HTTP Response Handler ​

The HTTP Response Handler validates the response from an HTTP Request task and makes it available for mapping in later tasks.

TIP

This page is about handling the response of an HTTP Request task. To return data from your endpoint, see HTTP Response instead.

HTTP Response Handler

Settings ​

Define a schema that the returned data must match.

Output ​

The validated response can be accessed by later tasks in the same way as the input data, or the output of Mapping tasks.

It is possible to receive streams from an HTTP Request and map them into another task. However, to consume the stream in a task you must encode it to a base64 string using the inbuilt function --*AG:Base64Encode(String or Stream To Encode)*--.

Examples ​

Encoding a response stream so it can be used in a JSON task, where --*responseStream*-- is a reference to the stream of a response handler task:

{
  "foo": --*AG:Base64Encode(--*responseStream*--)*--
}

Notes ​

  • The HTTP Response Handler is only used when paired with an HTTP Request. This pairing is defined when creating the tasks.

  • A Response Handler is not required if you do not care about the result of the HTTP Request.

  • If you return a stream without encoding it, in an output task set to a data type such as JSON or XML, you will receive a string reference to the stream and not the stream itself:

    {
      "myJson": "--*responseStream*--" // this will return "Stream Content"
    }