Skip to content

FetchClient ​

Methods on the client returned by createFetch.

MethodDescription
get / post / put / patch / deleteTyped HTTP helpers
request(method, path, options?)Generic verb
upload(path, options?)Multipart + progress — not on the core tanstack-fetch client (use /sse, /live, providers)
sse(path, options?)From tanstack-fetch/sse or /live
ws(path, options?)WebSocket — only from tanstack-fetch/live (guide)
transport(path, options?)WebTransport (HTTP/3 datagrams) — only from tanstack-fetch/live
stream(path, options?)NDJSON AsyncIterable — only from tanstack-fetch/live
use(name, interceptor)Register interceptor
eject(name)Remove interceptor

Request options ​

OptionNotes
paramsTyped from path (:id / {id}), required when placeholders exist. Only the pathname is scanned — ports and ?query colons are ignored
queryQuery string
bodyObjects → JSON; string, FormData, Blob, URLSearchParams, ArrayBuffer, typed arrays and ReadableStream are sent as-is
headersPer-request headers
signalAbortSignal (pass Query’s)
timeoutMsOverride client timeout (default 30 000). Rejects with TimeoutError — see isAbortError
parseAsjson | text | blob
operationName for interceptor match
interceptorsPer-request use / eject
onUploadProgressBrowser upload progress (XHR) — ignored by core tanstack-fetch; use /sse / /live
onDownloadProgressBrowser download progress (XHR) — ignored by core tanstack-fetch; use /sse / /live

MIT Licensed · Created by Mohammad Garmabi · Not an official TanStack package