Trilium Backend API
    Preparing search index...

    Interface RequestOptions<TOpaque>

    interface RequestOptions<TOpaque = null> {
        blocking?: boolean;
        body?:
            | string
            | Buffer<ArrayBufferLike>
            | Uint8Array<ArrayBufferLike>
            | Stream.Readable
            | FormData;
        bodyTimeout?: number;
        expectContinue?: boolean;
        headers?: UndiciHeaders;
        headersTimeout?: number;
        highWaterMark?: number;
        idempotent?: boolean;
        maxRedirections?: number;
        method: HttpMethod;
        onInfo?: (
            info: {
                headers: Record<string, string | string[]>;
                statusCode: number;
            },
        ) => void;
        opaque?: TOpaque;
        origin?: string
        | URL;
        path: string;
        query?: Record<string, any>;
        redirectionLimitReached?: boolean;
        reset?: boolean;
        responseHeaders?: "raw";
        signal?: unknown;
        throwOnError?: boolean;
        upgrade?: string | boolean;
    }

    Type Parameters

    • TOpaque = null

    Hierarchy (View Summary)

    Index

    Properties

    blocking?: boolean

    Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to true further pipelining will be avoided on the same connection until headers have been received. Defaults to method !== 'HEAD'.

    body?:
        | string
        | Buffer<ArrayBufferLike>
        | Uint8Array<ArrayBufferLike>
        | Stream.Readable
        | FormData

    Default: null

    bodyTimeout?: number

    The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds.

    expectContinue?: boolean

    For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server

    headers?: UndiciHeaders

    Default: null

    headersTimeout?: number

    The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds.

    highWaterMark?: number

    Default: 64 KiB

    idempotent?: boolean

    Whether the requests can be safely retried or not. If false the request won't be sent until all preceding requests in the pipeline have completed. Default: true if method is HEAD or GET.

    maxRedirections?: number

    Default: 0

    method: HttpMethod
    onInfo?: (
        info: { headers: Record<string, string | string[]>; statusCode: number },
    ) => void

    Default: null

    opaque?: TOpaque

    Default: null

    origin?: string | URL
    path: string
    query?: Record<string, any>

    Query string params to be embedded in the request URL. Default: null

    redirectionLimitReached?: boolean

    Default: false

    reset?: boolean

    Whether the request should stablish a keep-alive or not. Default false

    responseHeaders?: "raw"

    Default: null

    signal?: unknown

    Default: null

    throwOnError?: boolean

    Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false

    upgrade?: string | boolean

    Upgrade the request. Should be used to specify the kind of upgrade i.e. 'Websocket'. Default: method === 'CONNECT' || null.