Parameters
- fetch: {
(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
(input: string | Request | URL, init?: RequestInit): Promise<Response>;
}
-
- (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
-
Parameters
- input: RequestInfo | URL
Optionalinit: RequestInit
Returns Promise<Response>
- (input: string | Request | URL, init?: RequestInit): Promise<Response>
-
Parameters
- input: string | Request | URL
Optionalinit: RequestInit
Returns Promise<Response>
A Middleware delegating every exchange to fetch, ignoring the Fetch implementation it
wraps
Creates a middleware routing exchanges through a given fetch implementation.
Supplies the transport a client is to run on, for instance a proxy-bound
undicifetch, a platform service binding, or a test double, in place of the standard function createFetch would otherwise delegate to:Ignores the Fetch implementation it wraps, delegating every exchange to
fetchinstead: middlewares declared before it process exchanges as usual, while middlewares declared after it are never reached, so this middleware is to be declared last in a chain.