Expand description
The Fetch API’s types, as the routes and everything that calls out use
them: Request, Response, Headers, URL, URLSearchParams, and an
injected fetch.
Structs§
- Fetch
Init - What a request is sent with, the keys fetch’s
inittakes where they apply. - Headers
- Header names matched without regard to case, as the Fetch API’s
Headersare.getjoins repeated values with", "; Set-Cookie is kept apart, since its values may hold commas, and read back withget_set_cookie. - NoFetcher
- A Fetcher that fails every request, for a build without
transport. - Request
- An incoming request, shaped like the Fetch API’s
Requestso the routes read as the TypeScript SDK’s do: an absolute URL, a method, headers, the body already read, and the address the connection came from (an adapter’sRequestContext.ip), before any proxy header is read. - Reqwest
Fetcher - The default Fetcher: reqwest, on rustls with the platform’s roots.
- Response
- An answer: a status, headers, and the whole body.
- Search
Params - Query parameters as
URLSearchParamsreads and writes them: pairs kept in order,+read as a space, bytes that are not UTF-8 read as U+FFFD, and written back in the application/x-www-form-urlencoded form. - Url
- A parsed URL, as
new URL(input, base)makes one.
Enums§
- Fetch
Error - No answer came back: refused, timed out, bad TLS, or a body past its cap.
Constants§
- DEFAULT_
MAX_ BYTES - The most an answer may weigh when the request names no limit, enough for a connected install’s largest export, so no server can stream an answer into memory without end.
Traits§
- Fetcher
- Everything that calls another server (mail services, importers, connected installs, the assistant’s providers, site icons) goes through one, so tests and apps can pass their own.
Functions§
- default_
fetcher - The Fetcher used when none is given:
ReqwestFetcherwith thetransportfeature, else one that fails every request. - utf8
- Text as
TextDecodergives it: U+FFFD where the bytes are not UTF-8, and no byte order mark.
Type Aliases§
- Shared
Fetcher - A shared Fetcher.