Expand description
Standalone HTTP client mirroring Playwright’s APIRequestContext /
APIResponse.
Unlike crate::Request/crate::Response (which represent network
traffic captured inside the browser page), an APIRequestContext is a
direct HTTP client — useful for exercising APIs alongside browser
automation. It carries a single shared reqwest::Client and a set of
default headers, and exposes the usual get/post/put/… verbs.
Obtain one via crate::Page::request or crate::BrowserContext::request.
Structs§
- APIRequest
Context - A standalone HTTP client. Cheap to clone — it shares one underlying
reqwest::Clientand a set of default headers. - APIResponse
- A captured HTTP response. The full body is read once at construction and
cached, so
APIResponse::body,APIResponse::text, andAPIResponse::jsonare cheap and re-entrant. - ApiRequest
Context Options - Configuration for building an
APIRequestContext.