> 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/headers-cookies-and-paths.md).

# Headers, Cookies & Paths

For all requests, certain details can be provided through headers, paths or cookies

## Request Origin

Identifies the source of a request (such as application, user geolocation), and can be populated using:

* "Rierino-Origin" Header: As base64 encoded Json string
* "Rierino-Origin" Cookie: As base64 encoded Json string
* "User-Agent" Header: Sets origin.agent
* "Referrer" Header: Sets origin.referrer
* "X-Forwarded-For", "Forwarded" Headers, Request Address: Sets origin.ip

## Authentication

Provides authentication details (such as credentials, api key or tokens), and can be populated using:

* "Rierino-Auth.\[parameter]" Header: Sets auth.parameter
* "Rierino-Auth.\[parameter]" Cookie: Sets auth.parameter
* "Bearer" Authorization Header: As base64 encoded Json string prefixed with "base64="
* "Bearer" Authorization Header: As comma separated "parameter:value,parameter:value" pairs prefixed with "multi="
* "Basic" Authorization Header: As base64 encoded username:password parameters
* "\[parameter]" Authorization Header: Sets auth.parameter where comma separated "parameter value, parameter value" pairs are allowed

## Branch

For sending requests for a specific "branch", two alternative methods can be used:

* {channel} can be suffixed with @{branch}, such as rpc\@beta
* Sending branch as "X-Branch" header, such as X-Branch=beta

## Audit

If the gateway & channels allow, following headers can be used for auditing saga flows:

* "rierino-audit-path": Json path to return audit results (e.g. audit)
* "rierino-stop-step": ID of the step to stop execution of a saga to see partial results

## Async Requests

For making API calls that should fire & forget, a special "X-Async" header can be used with 2 alternative values:

* **gateway:** The request is received at the API gateway and immediately returned to the requestor with a request ID (even if the backend is not accessible). The gateway keeps communication ongoing with the backend as long as the process runs.
* **backend:** The request is forwarded to the backend as a fire & forget saga call, and the backend returns a dedicated process ID. The backend keeps running but the communication between gateway and backend is completed immediately.

{% hint style="info" %}
In addition to async request header, sagas can be individually configured to be fire & forget in nature, which immediately return regardless of this header.
{% endhint %}


---

# 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/headers-cookies-and-paths.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.
