Expand description
A spec-faithful WHATWG Fetch model and the single send engine over
reqwest. A JS fetch global and a host’s own HTTP client API both
marshal into the same Request, go through the same send path,
and read back the same Response — there is no second code path.
Layout:
headers— the WHATWG header list.body— request/response body (Empty/Bytes/ stream).model—Request/Response+ theRedirectMode/Credentials/ResponseTypeenums andRemoteAddr.error— the typedFetchError.engine— the client pool and the one manual-redirect send loop.net_guard— SSRF policy (allow-list, metadata/private blocking).cookie— RFC 6265 parsing/matching for the context-bound path.multipart—multipart/form-dataserialization and parsing.bridge— the two-way cookie/defaults bridge to a host-owned jar (a browser context, a session store).cookiealso carries theCookierecord that bridge speaks.
Re-exports§
pub use body::Body;pub use body::ByteStream;pub use body::channel_stream;pub use bridge::BridgeFuture;pub use bridge::ContextBridge;pub use bridge::ContextDefaults;pub use cookie::Cookie;pub use cookie::SameSite;pub use error::FetchError;pub use headers::Headers;pub use model::Credentials;pub use model::RedirectMode;pub use model::RemoteAddr;pub use model::Request;pub use model::Response;pub use model::ResponseType;pub use multipart::MultipartField;pub use multipart::MultipartValue;pub use multipart::multipart_boundary;pub use multipart::multipart_boundary_of;pub use multipart::parse_multipart;pub use multipart::serialize_multipart;pub use net_guard::GuardError;pub use net_guard::NetGuard;pub use net_guard::NetPolicy;pub use net_guard::check_url;pub use net_guard::preflight;pub use engine::ClientPool;pub use engine::send;pub use reqwest;
Modules§
- body
- Request / response body.
- bridge
- Two-way bridge between the engine and a host-owned cookie jar.
- cookie
- RFC 6265 cookie parsing and matching for the bridged request path.
Ported from Playwright’s
server/cookieStore.ts+server/fetch.tscookie handling: the host’s context is the jar, so the outgoingCookieheader is assembled here from its cookies and every hop’sSet-Cookieis parsed back with the same defaults Playwright applies. - engine
- The one send engine.
- error
- Typed error for the fetch engine.
- headers
- WHATWG header list.
- model
- The WHATWG request/response model the engine sends and returns.
- multipart
multipart/form-dataserialization, shared by the request-option lowering and the JSFormDatabody path so both express multipart identically. Mirrors Playwright’sFormField.- net_
guard - Sandbox network guard (SSRF defense).