impit
    Preparing search index...

    Interface RequestInit

    Options for configuring an individual HTTP request.

    These options allow you to customize the behavior of a specific request, including the HTTP method, headers, body, timeout, and whether to force HTTP/3.

    If no options are provided, default settings will be used.

    See Impit.fetch for usage.

    interface RequestInit {
        body?:
            | string
            | ArrayBuffer
            | DataView<ArrayBufferLike>
            | Uint8Array<ArrayBufferLike>
            | Blob
            | FormData
            | URLSearchParams
            | File
            | ReadableStream<any>;
        forceHttp3?: boolean;
        headers?: Record<string, string> | [string, string][] | Headers;
        method?: HttpMethod;
        timeout?: number;
    }
    Index

    Properties

    body?:
        | string
        | ArrayBuffer
        | DataView<ArrayBufferLike>
        | Uint8Array<ArrayBufferLike>
        | Blob
        | FormData
        | URLSearchParams
        | File
        | ReadableStream<any>

    Request body. Can be a string, Buffer, ArrayBuffer, TypedArray, DataView, Blob, File, URLSearchParams, FormData or ReadableStream.

    forceHttp3?: boolean

    Force the request to use HTTP/3. If the server doesn't expect HTTP/3 or the Impit instance doesn't have HTTP/3 enabled (via the ImpitOptions.http3 option), the request will fail.

    headers?: Record<string, string> | [string, string][] | Headers

    Additional headers to include in the request.

    Can be an object, a Map, or an array of tuples or an instance of the Headers class.

    Note that headers set here will override any default headers set in ImpitOptions.headers.

    method?: HttpMethod

    HTTP method to use for the request. Default is GET.

    Can be one of: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS.

    timeout?: number

    Request timeout in milliseconds. Overrides the Impit-wide timeout option from ImpitOptions.timeout.