Interact with a Playwright network request.
Summary
Functions
Waits for the request's response headers and returns {:ok, %{guid: response_id}}.
Types
@type response_opt() :: {:connection, GenServer.name()} | {:timeout, timeout()}
Functions
@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