string body([string request-id])

The body function provides access to an upstream response body. The result is the raw body – if needed, parsing has to be done explictly.

When called without a parameter, the function returns the body for the request with the ID main, which is the default ID for an upstream request.


{"url": ""}
{"id": "xml", "url": ""}
<eval out="$json">json-parse(body())</eval>
<eval out="$dom">xml-parse(body('xml'))</eval>

See also