Type of the parsed response data
Type of request headers
Type of request params
Type of response headers
Creates a new Promise.
Type of the parsed response data
Type of request headers
Type of request params
Type of response headers
A callback used to initialize the promise. This callback is passed two arguments: a resolve callback used to resolve the promise with a value or the result of another promise, and a reject callback used to reject the promise with a provided reason or error.
The active response directive, if any.
Whether the request was aborted, either via abort() or
an external signal on the controller.
Whether the executor has resolved or rejected (without abort).
Whether stream mode is active.
Async iterator that yields response body chunks as Uint8Array.
Only available after calling .stream(). Reads from the underlying
ReadableStream and releases the reader lock when iteration ends.
Abort the in-flight request.
Sets isAborted and delegates to the stored AbortController.
Safe to call even when no controller is present (plain constructor).
Optionalreason: stringParse the response body as an ArrayBuffer.
Parse the response body as a Blob.
Attaches a callback for only the rejection of the Promise.
Optionalonrejected: ((reason: any) => TResult | PromiseLike<TResult>) | nullThe callback to execute when the Promise is rejected.
A Promise for the completion of the callback.
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Optionalonfinally: (() => void) | nullThe callback to execute when the Promise is settled (fulfilled or rejected).
A Promise for the completion of the callback.
Parse the response body as FormData.
Parse the response body as JSON.
Return the raw Response object without parsing.
Enable streaming mode for the response.
Returns the raw Response and marks the promise for async iteration over response body chunks.
Parse the response body as plain text.
Attaches callbacks for the resolution and/or rejection of the Promise.
Optionalonfulfilled: ((value: FetchResponse) => TResult1 | PromiseLike<TResult1>) | nullThe callback to execute when the Promise is resolved.
Optionalonrejected: ((reason: any) => TResult2 | PromiseLike<TResult2>) | nullThe callback to execute when the Promise is rejected.
A Promise for the completion of which ever callback is executed.
StaticallCreates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
An array of Promises.
A new Promise.
StaticallCreates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
An array of Promises.
A new Promise.
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
An array of Promises.
A new Promise.
StaticanyThe any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
An array or iterable of Promises.
A new Promise.
The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.
An array or iterable of Promises.
A new Promise.
StaticcreateFactory that wires an executor and AbortController into a FetchPromise with automatic finish/abort tracking.
Replaces the previous pattern of patching abort state onto a plain promise, giving callers a typed, first-class abort surface.
StaticraceStaticrejectStaticresolveStatictryTakes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result in a Promise.
A function that is called synchronously. It can do anything: either return a value, throw an error, or return a promise.
Additional arguments, that will be passed to the callback.
A Promise that is:
StaticwithCreates a new Promise and returns it in an object, along with its resolve and reject functions.
An object with the properties promise, resolve, and reject.
const { promise, resolve, reject } = Promise.withResolvers<T>();
Extended Promise that carries a response directive for the fetch engine.
Enables a fluent API where callers declare their expected response type (e.g.
.json(),.text(),.blob()) before awaiting. The directive is read by the executor to determine how to parse the response body.An override guard prevents setting the directive more than once, catching accidental double-calls that would silently discard the first directive.
Example