Skip to content

Latest commit

 

History

History
68 lines (39 loc) · 2.38 KB

HttpRequestOptions.md

File metadata and controls

68 lines (39 loc) · 2.38 KB

Interface: HttpRequestOptions<Method, BodyType>

💗 Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


Type Parameters

Type Parameter Default type
Method -
BodyType undefined

Properties

[allowInsecureRequests]?

optional [allowInsecureRequests]: boolean

See allowInsecureRequests.

Deprecated


[customFetch]()?

optional [customFetch]: (url, options) => Promise<Response>

See customFetch.

Parameters

Parameter Type Description
url string URL the request is being made sent to fetch as the resource argument
options CustomFetchOptions<Method, BodyType> Options otherwise sent to fetch as the options argument

Returns

Promise<Response>


headers?

optional headers: Record<string, string> | [string, string][] | Headers

Headers to additionally send with the HTTP request(s) triggered by this function's invocation.


signal?

optional signal: AbortSignal | () => AbortSignal

An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by this function's invocation.

Example

A 5000ms timeout AbortSignal for every request

let signal = () => AbortSignal.timeout(5_000) // Note: AbortSignal.timeout may not yet be available in all runtimes.