IRequestOpts
Defined in: src/http-api/interface.ts:126
Options object for FetchHttpApi.requestOtherUrl.
Extends
Section titled “Extends”Properties
Section titled “Properties”abortSignal?
Section titled “abortSignal?”
optionalabortSignal?:AbortSignal
Defined in: src/http-api/interface.ts:90
Inherited from
Section titled “Inherited from”baseUrl?
Section titled “baseUrl?”
optionalbaseUrl?:string
Defined in: src/http-api/interface.ts:131
The alternative base url to use. If not specified, uses this.opts.baseUrl
headers?
Section titled “headers?”
optionalheaders?:Record<string,string>
Defined in: src/http-api/interface.ts:89
map of additional request headers
Inherited from
Section titled “Inherited from”inhibitLogoutEmit?
Section titled “inhibitLogoutEmit?”
optionalinhibitLogoutEmit?:boolean
Defined in: src/http-api/interface.ts:141
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.
Inherited from
Section titled “Inherited from”keepAlive?
Section titled “keepAlive?”
optionalkeepAlive?:boolean
Defined in: src/http-api/interface.ts:96
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”BaseRequestOpts.localTimeoutMs
prefix?
Section titled “prefix?”
optionalprefix?:string
Defined in: src/http-api/interface.ts:136
The full prefix to use e.g. “/_matrix/client/v2_alpha”. If not specified, uses this.opts.prefix.
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”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.