> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/devops/api-gateway-and-security/apis/response-formats.md).

# Response Formats

In addition to JSON, gateway servers can return results in other formats such as XML, HTML, CSV and plain text

Rierino gateway servers support returning responses in following formats, while request body should always be in JSON format:

## JSON

By default, all API responses are returned in JSON data format across all gateway servers even when "Accept: application/json" header is not provided.

## XML

It is possible to request response in XML format using either of the following:

* **Accept Header:** Sending requests with "Accept: application/xml" header.&#x20;
* **Path Extension:** Sending requests with ".xml" extension in url path (e.g. /api/request/rpc/Hello.xml).

Returned XML is a direct conversion of JSON response into XML form, wrapped inside a \<root> element.

## HTML

It is possible to request response as a HTML text using either of the following:

* **Accept Header:** Sending requests with "Accept: text/html" header.&#x20;
* **Path Extension:** Sending requests with ".html" extension in url path (e.g. /api/request/rpc/HomePage.html).

Returned HTML is the "html" (or "result.html" if missing) element of JSON response body, hence called saga endpoint should return produced html contents in such element.

## Plain Text

It is possible to request response as a plain text using either of the following:

* **Accept Header:** Sending requests with "Accept: text/plain" header.&#x20;
* **Path Extension:** Sending requests with ".txt" extension in url path (e.g. /api/request/rpc/Hello.txt).

Returned text is the "plain" (or "result.plain" if missing) element of JSON response body, hence called saga endpoint should return produced text contents in such element.

## CSV

It is possible to request response as a comma separated list using either of the following:

* **Accept Header:** Sending requests with "Accept: text/csv" header.&#x20;
* **Path Extension:** Sending requests with ".csv" extension in url path (e.g. /api/request/rpc/GetProducts.csv).

Returned CSV contents is produced from the "list" (or "result.list" if missing) element of JSON response body, hence called saga endpoint should return a JSON array in such element.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/devops/api-gateway-and-security/apis/response-formats.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
