Sanity Library Reference Docs
    Preparing search index...
    interface RequestOptions {
        url: string;
        body?: any;
        bodySize?: number;
        cancelToken?: any;
        compress?: boolean;
        headers?: any;
        maxRedirects?: number;
        maxRetries?: number;
        retryDelay?: (attemptNumber: number) => number;
        method?: string;
        proxy?: string | false | ProxyOptions | null;
        query?: any;
        rawBody?: boolean;
        shouldRetry?: any;
        stream?: boolean;
        timeout?: any;
        tunnel?: boolean;
        debug?: any;
        requestId?: number;
        attemptNumber?: number;
        withCredentials?: boolean;
        fetch?: boolean | Omit<RequestInit, "method">;
        useAbortSignal?: boolean;
    }
    Index

    Properties

    url: string
    body?: any
    bodySize?: number
    cancelToken?: any
    compress?: boolean
    headers?: any
    maxRedirects?: number
    maxRetries?: number
    retryDelay?: (attemptNumber: number) => number
    method?: string
    proxy?: string | false | ProxyOptions | null
    query?: any
    rawBody?: boolean
    shouldRetry?: any
    stream?: boolean
    timeout?: any
    tunnel?: boolean
    debug?: any
    requestId?: number
    attemptNumber?: number
    withCredentials?: boolean
    fetch?: boolean | Omit<RequestInit, "method">

    Enables using the native fetch API instead of the default http module, and allows setting its options like cache

    useAbortSignal?: boolean

    Some frameworks have special behavior for fetch when an AbortSignal is used, and may want to disable it unless userland specifically opts-in.