# Request Headers Example

> Discover how to access request headers using g.req.headers in API Maker with a clear example.

Source: https://docs.apimaker.dev/v1/examples/req/headers/reqHeaders.html

To get the value of requested headers, use `g.req.headers`.

```ts
const req_headers = g.req.headers;
```

The [tenant header](https://docs.apimaker.dev/v1/docs/apis-all/header/requestHeader.html#x-am-tenant-username) of a request of a tenant of a [multi-tenant](https://docs.apimaker.dev/v1/docs/features/multi-tenant.html) instance. `g.req.params.tenantUsername` holds the tenant too, also when the request named it in the path (`crm::acme`).

```ts
const tenantUsername = g.req.headers['x-am-tenant-username']; // 'acme'
```

## Related

- [The global object g](https://docs.apimaker.dev/v1/docs/pre-defined-terms/global-object-g.html) · [Custom APIs](https://docs.apimaker.dev/v1/docs/apis-all/custom-apis/user-created-custom-api.html)
