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

> Make an out-of-band HTTP request and capture the response.

Runs server-side without going through the browser. Combine with `saveAs` to
feed the response into later steps.

## 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`    | `unknown`                | No       | Request body.                                                         |
| `timeout` | `number`                 | No       | Maximum time in milliseconds.                                         |
| `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.                                     |

## Shorthand

URL as a single string. Defaults to GET.

```yaml theme={null}
- request: https://postman-echo.com/get
```

## Examples

```yaml theme={null}
- request:
    url: https://postman-echo.com/get
    headers:
      test-header: header {{ env.TEST_VALUE }}
    params:
      test-param: param {{ env.TEST_VALUE }}
    saveAs: GET_REQUEST
```

```yaml theme={null}
- request:
    url: https://postman-echo.com/post
    method: POST
    headers:
      test-header: header {{ env.TEST_VALUE }}
    params:
      test-param: param {{ env.TEST_VALUE }}
    body:
      payload: "{{ env.TEST_VALUE }}"
    saveAs: POST_REQUEST
```

## Related

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