Skip to content

IRequestOpts

Defined in: src/http-api/interface.ts:126

Options object for FetchHttpApi.requestOtherUrl.

optional abortSignal?: AbortSignal

Defined in: src/http-api/interface.ts:90

BaseRequestOpts.abortSignal


optional baseUrl?: string

Defined in: src/http-api/interface.ts:131

The alternative base url to use. If not specified, uses this.opts.baseUrl


optional headers?: Record<string, string>

Defined in: src/http-api/interface.ts:89

map of additional request headers

BaseRequestOpts.headers


optional inhibitLogoutEmit?: boolean

Defined in: src/http-api/interface.ts:141


optional json?: boolean

Defined in: src/http-api/interface.ts:113

By default, we will:

  • If the body is an object, JSON-encode it and set Content-Type: application/json in the request headers (unless overridden by headers).

  • Set Accept: application/json in 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.

BaseRequestOpts.json


optional keepAlive?: boolean

Defined in: src/http-api/interface.ts:96

BaseRequestOpts.keepAlive


optional localTimeoutMs?: 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.

BaseRequestOpts.localTimeoutMs


optional prefix?: 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.


optional priority?: RequestPriority

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:2569

BaseRequestOpts.priority


optional rawResponseBody?: boolean

Defined in: src/http-api/interface.ts:123

Setting this to true does two things:

BaseRequestOpts.rawResponseBody