---
title: "addHeader( key, value ) | Grafana k6 documentation"
description: "adds a header to the session"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# addHeader( key, value )

Expand table

| Parameter | Type   | Description  |
|-----------|--------|--------------|
| name      | string | Header name  |
| value     | string | Header value |

### Example

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import { Httpx } from 'https://jslib.k6.io/httpx/0.1.0/index.js';

const session = new Httpx({ baseURL: 'https://quickpizza.grafana.com' });

session.addHeader('Authorization', 'token abcdef0123456789');

export default function () {
  session.get('/api/ratings');
}
```
