fynjs API
    Preparing search index...

    Interface FynFetchOptions

    interface FynFetchOptions {
        body?: BodyInit | ReadableStream;
        bodyFactory?: () => BodyInit | Promise<(BodyInit | undefined)> | undefined;
        cache?: RequestCache;
        cookies?: Record<string, string>;
        credentials?: RequestCredentials;
        dispatcher?: Dispatcher;
        duplex?: "half";
        form?: URLSearchParams | Record<string, any>;
        headers?: HeadersInit;
        hooks?: FynFetchHooks;
        integrity?: string;
        json?: any;
        keepalive?: boolean;
        method?: string;
        mode?: RequestMode;
        password?: string;
        prefixUrl?: string | URL;
        redirect?: RequestRedirect;
        referrer?: string;
        referrerPolicy?: ReferrerPolicy;
        retry?: number | RetryOptions;
        searchParams?: SearchParamsInit;
        signal?: AbortSignal | null;
        throwOnHttpError?: boolean;
        timeout?: number;
        username?: string;
        window?: null;
    }

    Hierarchy

    • Omit<RequestInit, "body">
      • FynFetchOptions
    Index
    body?: BodyInit | ReadableStream

    Request body. Supports standard RequestInit body, Node.js Readable streams, or null.

    bodyFactory?: () => BodyInit | Promise<(BodyInit | undefined)> | undefined

    Factory function to generate a fresh body for streaming retries.

    cache?: RequestCache
    cookies?: Record<string, string>

    Key-value map of cookies to set in the Cookie header.

    credentials?: RequestCredentials
    dispatcher?: Dispatcher
    duplex?: "half"

    Node.js fetch duplex option. Auto-detected as 'half' for streams.

    form?: URLSearchParams | Record<string, any>

    Shortcut to send application/x-www-form-urlencoded body.

    headers?: HeadersInit

    Request lifecycle hooks.

    integrity?: string
    json?: any

    Shortcut to send JSON body. Automatically stringifies and sets Content-Type: application/json and Accept: application/json if unset.

    keepalive?: boolean
    method?: string
    mode?: RequestMode
    password?: string

    Password for HTTP Basic Authentication.

    prefixUrl?: string | URL

    Base URL to prepend to relative URL paths.

    redirect?: RequestRedirect
    referrer?: string
    referrerPolicy?: ReferrerPolicy
    retry?: number | RetryOptions

    Retry configuration or integer count of retries.

    searchParams?: SearchParamsInit

    Query parameters to append to the URL.

    signal?: AbortSignal | null
    throwOnHttpError?: boolean

    Automatically throw HttpError when !res.ok. Default: false (except in .json(), .text(), .buffer(), etc. where default is true)

    timeout?: number

    Total timeout in milliseconds, covering both the response headers and the body read (including stream() pipelines). Merged with any caller-supplied signal. Applied per attempt, so N retries can take up to N x timeout.

    Exceeding it aborts the request with a TimeoutError; if the deadline lands mid-body, the pending body read rejects with that same error.

    username?: string

    Username for HTTP Basic Authentication.

    window?: null