# `PlaywrightEx.Request`
[🔗](https://github.com/ftes/playwright_ex/blob/v0.13.0/lib/playwright_ex/channels/request.ex#L1)

Interact with a Playwright network request.

# `response_opt`

```elixir
@type response_opt() :: {:connection, GenServer.name()} | {:timeout, timeout()}
```

# `response`

```elixir
@spec response(PlaywrightEx.guid(), [response_opt() | PlaywrightEx.unknown_opt()]) ::
  {:ok, %{guid: PlaywrightEx.guid()} | nil} | {:error, any()}
```

Waits for the request's response headers and returns `{:ok, %{guid: response_id}}`.

Returns `{:ok, nil}` if the request fails without receiving a response.
HTTP error statuses such as 404 still produce a response. Redirects have
separate requests; this returns the response for the supplied request.

Response events do not need to be enabled. Read response metadata with
`PlaywrightEx.Connection.initializer!(connection, response_id)`.

Reference: https://playwright.dev/docs/api/class-request#request-response

## Options
* `:connection` (`t:term/0`) - The Connection process name. Defaults to `PlaywrightEx.Supervisor.Connection`. The default value is `PlaywrightEx.Supervisor.Connection`.

* `:timeout` (`t:timeout/0`) - Required. Operation timeout in milliseconds. `0` means no waiting; `:infinity` disables the timeout.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
