> For the complete documentation index, see [llms.txt](https://sevenval.gitbook.io/flat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sevenval.gitbook.io/flat/reference/functions/body.md).

# body()

```
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](/flat/reference/actions/request.md).

## Example

```markup
<flow>
  <request>
    {"url": "https://example.com/json"}
  </request>
  <request>
    {"id": "xml", "url": "https://example.com/xml"}
  </request>

  <eval out="$json">json-parse(body())</eval>
  <eval out="$dom">xml-parse(body('xml'))</eval>
  …
</flow>
```

## See also

* [Processing Upstream Responses](/flat/cookbook/upstream-response.md)
* [`pass-body` action](/flat/reference/actions/pass-body.md)
* [`request` action](/flat/reference/actions/request.md)
