API reference@evolu/common › Http

Task-aware HTTP helpers.

Fetch

NameDescription
FetchBodyErrorError returned when a body mode cannot read or decode a 2xx response.
FetchStatusErrorError returned when a body mode receives a non-2xx response.
FetchTransportErrorError returned when the native fetch request fails before a response exists.
NativeFetchDepDependency wrapper for NativeFetch.
FetchConsumeConsumes a native Response before fetch settles.
FetchErrorError returned by fetch body modes.
FetchModeBody mode for fetch.
FetchResponseBody-free Response view safe to return from fetch.
NativeFetchWHATWG-fetch-compatible function used by fetch.
fetchFetches a resource and consumes the Response inside the Task, so the body is read while the request signal is still alive.

Testing

NameDescription
TestNativeFetchTest NativeFetch that records calls and serves queued handlers.
TestNativeFetchCallRecorded TestNativeFetch call.
TestNativeFetchHandlerHandler for one TestNativeFetch call.
testCreateNativeFetchCreates TestNativeFetch.
testCreateNativeFetchErroringBodyCreates a Response body for NativeFetch tests that errors on first read.