Anchorage API reference
    Preparing search index...

    RequestInit subset the guarded fetch understands. The guard forwards own enumerable members and the standard and Workers request-init members it defines, whether own or inherited, reading each once per call. Class instances, Object.create objects, and Requests passed as init retain their method, headers, body, and signal. The base fetch always receives redirect: 'manual'; the guard applies the checked mode itself.

    interface EgressRequestInit {
        body?: unknown;
        headers?: unknown;
        method?: string;
        redirect?: "error" | "follow" | "manual";
        signal?: unknown;
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index

    Properties

    body?: unknown

    Request body forwarded to the base fetch.

    headers?: unknown

    Header initializer forwarded to the base fetch.

    method?: string

    HTTP method. Defaults to the base fetch implementation's default.

    redirect?: "error" | "follow" | "manual"

    'follow' (default) follows redirects with a per-hop allowlist check. 'manual' returns a 3xx to the caller; no hop happens here, so nothing escapes the initial check. 'error' rejects a 301, 302, 303, 307 or 308 response, or a browser's opaque redirect, with TypeError('fetch failed') whose cause is Error('unexpected redirect'), as Node's fetch does. It behaves the same on Workers, whose fetch refuses 'error'. Any other value is refused with EGRESS_INPUT_INVALID before any request.

    signal?: unknown

    Cancellation signal forwarded to the base fetch.