Documentation
    Preparing search index...

    Interface JSONRequestOptions<T>

    interface JSONRequestOptions<T = unknown> {
        body?: Jsonifiable;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        headers?: HeadersInit;
        keepalive?: boolean;
        method?: string;
        onResponse?: (
            response: Response,
            request: Request,
        ) => void | Response | Promise<void | Response>;
        poll?: boolean | PollOptions;
        redirect?: RequestRedirect;
        retry?: boolean | RetryOptions;
        schema?: StandardSchemaV1<unknown, T>;
        signal?: AbortSignal;
        timeout?: number | false;
    }

    Type Parameters

    • T = unknown
    Index

    Properties

    body?: Jsonifiable
    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    }

    Type Declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | URL | Request, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | URL | Request
        • Optionalinit: RequestInit

        Returns Promise<Response>

    headers?: HeadersInit
    keepalive?: boolean
    method?: string
    onResponse?: (
        response: Response,
        request: Request,
    ) => void | Response | Promise<void | Response>
    poll?: boolean | PollOptions

    Poll responses that match the configured status codes.

    Set to true to use the default polling options.

    false
    
    redirect?: RequestRedirect
    retry?: boolean | RetryOptions

    Retry failed requests.

    Set to true to use the default retry options.

    false
    
    schema?: StandardSchemaV1<unknown, T>
    signal?: AbortSignal
    timeout?: number | false

    Timeout in milliseconds for the request, false to disable timeout

    5000