> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# header

> Set an HTTP request header on outgoing requests.

Applies the header to subsequent requests. Without any URL matcher, the header
applies to every request. With a matcher, only matching requests get the header.

## Parameters

| Parameter   | Type      | Required | Description                                                            |
| ----------- | --------- | -------- | ---------------------------------------------------------------------- |
| `name`      | `string`  | Yes      | Header name.                                                           |
| `value`     | `string`  | Yes      | Header value.                                                          |
| `substring` | `string`  | No       | Match URLs that contain this substring.                                |
| `glob`      | `string`  | No       | Match URLs against a glob pattern.                                     |
| `regex`     | `string`  | No       | Match URLs against a regular expression.                               |
| `domain`    | `string`  | No       | Match all URLs under the given domain.                                 |
| `method`    | `string`  | No       | Restrict the header to a specific HTTP method. Requires a URL matcher. |
| `saveAs`    | `string`  | No       | Name of the variable to write this step's return value to.             |
| `retries`   | `number`  | No       | Number of times to retry the step on failure before failing the test.  |
| `skipped`   | `boolean` | No       | Skip this step at execution time.                                      |

## Examples

```yaml theme={null}
- header:
    name: "{{ env.HEADER_NAME_GLOBAL }}"
    value: "{{ env.HEADER_VALUE }}"
```

```yaml theme={null}
- header:
    name: "{{ env.HEADER_NAME_MATCHER_TRUE }}"
    value: "{{ env.HEADER_VALUE }}"
    domain: httpbin.org
```

```yaml theme={null}
- header:
    name: x-feature-flag
    value: "true"
    regex: .+/api/.+
```

## Related

* [Network requests](/guides/page-interactions/network-requests)
* [Test format](/core-concepts/test-format)
