fetrest
    Preparing search index...

    Type Alias FRRequestOptions<TBody>

    Options for an indivdual request

    type FRRequestOptions<TBody = unknown> = {
        body?: TBody;
        fetchFn?: FetchFn;
        fetchOpts?: RequestInit;
        headers?: Record<string, string>;
        params?: Record<string, string | number>;
        query?: Record<
            string,
            string
            | string[]
            | number
            | number[]
            | boolean
            | undefined,
        >;
        rawResponse?: boolean;
    }

    Type Parameters

    • TBody = unknown
    Index

    Properties

    body?: TBody

    HTTP Body

    fetchFn?: FetchFn

    Override fetch function

    You can specify a fetch like function to be called, instead of fetch global function -- for this particular request.

    Note: This will override FROptions.fetchFn if specified both.

    fetchOpts?: RequestInit

    override fetch options for this request

    headers?: Record<string, string>

    HTTP Headers

    params?: Record<string, string | number>

    HTTP Path params

    query?: Record<
        string,
        string
        | string[]
        | number
        | number[]
        | boolean
        | undefined,
    >

    HTTP Query Params

    rawResponse?: boolean

    Flag to return raw response instead of parsed / extracted body