matrix-js-sdk

    Interface BaseRequestOpts

    Options object for FetchHttpApi.requestOtherUrl.

    interface BaseRequestOpts {
        abortSignal?: AbortSignal;
        headers?: Record<string, string>;
        json?: boolean;
        keepAlive?: boolean;
        localTimeoutMs?: number;
        rawResponseBody?: boolean;
    }

    Hierarchy (View Summary, Expand)

    Index

    Properties

    abortSignal?: AbortSignal
    headers?: Record<string, string>

    map of additional request headers

    json?: boolean

    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.

    Instead of setting this to false, set rawResponseBody to true.

    keepAlive?: boolean
    localTimeoutMs?: number

    The maximum amount of time to wait before timing out the request. If not specified, there is no timeout.

    rawResponseBody?: boolean

    Setting this to true does two things:

    MMNEPVFCICPMFPCPTTAAATR