Appearance
HTTP Response Handler
This page is about the task for handling the response of the HTTP Request task. If you are looking to return data from the endpoint, please see HTTP Response instead.
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.
You can define the expected shape of the data that you get back from the request, and store it for use by later tasks. This is accomplished by creating a schema that the returned data must match. It can then be accessed by future tasks in the same manner as the input data, or Mapping tasks.
It is possible to receive streams from a HTTP Request and map them into another task. However, in order to consume the stream in a task you must encode it to a base64 string by using the inbuilt function --*AG:Base64Encode(String or Stream To Encode)*--
.
e.g.
{
"foo": --*AG:Base64Encode(--*responseStream*--)*--
}
Where "--*responseStream*--"
is a reference to the stream of a reasponse handler task.
If you attempt to return a stream without encoding it in an output task which is set to a data type such JSON or XML you will receive a string reference to the stream and not the stream itself.
e.g
{
"myJson": "--*responseStream*--" // this will return "Stream Content"
}