Expand description
Pure-Rust W3C fetch() Engine with Headers, AbortController, and HTTP Framing.
Structs§
- Abort
Controller - W3C AbortController used to cancel in-flight network requests.
- Abort
Signal - W3C AbortSignal signaling cancellation of asynchronous requests.
- Form
Data - Multipart form data builder.
- Headers
- Case-insensitive HTTP Header map conforming to W3C Fetch spec.
- Parsed
Url - Parsed URL components.
- Request
Init - Configuration options for an HTTP request.
- Response
- HTTP Response representation.
Enums§
- Fetch
Error - Errors occurring during HTTP fetch requests.
- Request
Credentials - W3C Fetch credentials mode governing cookie inclusion in cross-origin requests.
- Request
Mode - W3C Fetch request mode governing Cross-Origin Resource Sharing.
Constants§
- MAX_
DECOMPRESSED_ SIZE - Maximum allowable decompressed payload size in bytes (Decompression bomb protection).
- MAX_
HEADER_ SIZE - Maximum allowable HTTP header size in bytes (RFC 7230 / Slowloris DoS prevention).
- MAX_
RESPONSE_ BODY_ SIZE - Maximum allowable HTTP response body size in bytes (128 MB).
Functions§
- compute_
origin - Computes the serialized origin (scheme + host + port) for an HTTP/HTTPS URL per RFC 6454 / W3C Fetch.
- decode_
chunked_ body - Decodes HTTP/1.1 chunked transfer encoded payloads.
- decompress_
body - Decompresses body bytes based on HTTP Content-Encoding (gzip, deflate, br) with strict decompression bomb expansion limits.
- fetch
- Executes an HTTP or HTTPS fetch request, following standard HTTP redirects and enforcing W3C CORS rules.
- fetch_
single - Executes a single HTTP or HTTPS fetch request without following redirects.
- is_
cors_ simple_ request - Checks whether an HTTP request qualifies as a CORS-simple request under W3C Fetch spec. Returns (is_simple, list_of_custom_headers).
- parse_
http_ response - Parses raw HTTP/1.1 response bytes into a structured
Response. - read_
http_ response - Reads an HTTP/1.1 response from a synchronous byte stream, enforcing RFC 7230 framing.
Terminates immediately upon reading
Content-Lengthbytes or the terminal chunk0\r\n\r\n, preventing hangs on persistent keep-alive connections. - resolve_
redirect_ url - Resolves a redirect location header against the base URL.