BaseRequestOpts
Defined in: src/http-api/interface.ts:85
Options object for FetchHttpApi.requestOtherUrl.
Extends
Section titled “Extends”Pick<RequestInit,"priority">
Extended by
Section titled “Extended by”Properties
Section titled “Properties”abortSignal?
Section titled “abortSignal?”
optionalabortSignal?:AbortSignal
Defined in: src/http-api/interface.ts:90
headers?
Section titled “headers?”
optionalheaders?:Record<string,string>
Defined in: src/http-api/interface.ts:89
map of additional request headers
optionaljson?:boolean
Defined in: src/http-api/interface.ts:113
By default, we will:
-
If the
bodyis an object, JSON-encode it and setContent-Type: application/jsonin the request headers (unless overridden by headers). -
Set
Accept: application/jsonin the request headers (again, unless overridden by headers). -
Parse the response as JSON and return the parsed response.
Setting this to false inhibits all three behaviors, and the response is instead parsed as a UTF-8 string. It
defaults to true, unless rawResponseBody is set.
keepAlive?
Section titled “keepAlive?”
optionalkeepAlive?:boolean
Defined in: src/http-api/interface.ts:96
localTimeoutMs?
Section titled “localTimeoutMs?”
optionallocalTimeoutMs?:number
Defined in: src/http-api/interface.ts:95
The maximum amount of time to wait before timing out the request. If not specified, there is no timeout.
priority?
Section titled “priority?”
optionalpriority?:RequestPriority
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:2569
Inherited from
Section titled “Inherited from”Pick.priority
rawResponseBody?
Section titled “rawResponseBody?”
optionalrawResponseBody?:boolean
Defined in: src/http-api/interface.ts:123
Setting this to true does two things:
-
Inhibits the automatic addition of
Accept: application/jsonin the request headers. -
Causes the raw response to be returned as a https://developer.mozilla.org/en-US/docs/Web/API/Blob|Blob instead of parsing it as JSON.