API reference › @evolu/common › Http › FetchMode
type FetchMode = "text" | "json" | "bytes" | "headers";
Defined in: packages/common/src/Http.ts:52
Body mode for fetch.
A mode selects a built-in consumer that reads the Response inside the fetch Task:
"bytes"— reads the body as aUint8Array<ArrayBuffer>."headers"— cancels the body and returns FetchResponse. Pair it with{ method: "HEAD" }when the server should not send a body."json"— parses the body as JSON and returnsunknown. Narrow or decode at the call site; there is deliberately no generic to cast through."text"— reads the body as a string.
Body modes ("bytes", "json", "text") return FetchStatusError for
non-2xx responses. "headers" does not judge status, because the status is
usually the value being asked for.