> ## 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.

# request

> Issue an HTTP request from the test.

Issues an HTTP request. The simplified form takes the URL as a single string and
issues a GET. Store the response with `saveAs`.

## Parameters

| Parameter  | Type                     | Required | Description                                                 |
| ---------- | ------------------------ | -------- | ----------------------------------------------------------- |
| `url`      | `string`                 | Yes      | Request URL.                                                |
| `method`   | `string`                 | No       | HTTP method. Defaults to GET.                               |
| `headers`  | `Record<string, string>` | No       | Request headers.                                            |
| `params`   | `Record<string, string>` | No       | Query parameters.                                           |
| `body`     | `string`                 | No       | Request body.                                               |
| `bodyType` | `string`                 | No       | Body encoding (e.g. JSON, form).                            |
| `timeout`  | `number`                 | No       | Request timeout in milliseconds.                            |
| `saveAs`   | `string`                 | No       | Variable to store this step's return value on `env.<name>`. |
| `retries`  | `number`                 | No       | Times to retry the step on failure before failing the test. |
| `skipped`  | `boolean`                | No       | Skip this step at execution time.                           |

## Shorthand

URL as a single string.

```yaml theme={null}
- request: https://api.example.com/health
```

## Examples

```yaml theme={null}
- request:
    url: https://api.example.com/orders
    method: POST
    headers:
      Authorization: "Bearer {{ env.TOKEN }}" # interpolate a saved variable
    body: '{ "item": "blanket" }'
    bodyType: json
    saveAs: ORDER # response is available as {{ env.ORDER }}
```

## Related

* [Test format](/core-concepts/test-format)
