kinetex - v1.0.0-rc.1
    Preparing search index...

    Class FetchTransport

    Universal fetch-based transport. Suitable for all runtimes where fetch is available.

    Implements

    • Transport
    Index

    Constructors

    Methods

    Constructors

    • Parameters

      • fetchFnOrOptions:
            | {
                (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
                (input: string | URL | Request, init?: RequestInit): Promise<Response>;
            }
            | FetchTransportOptions = globalThis.fetch

        Custom fetch function or options object

        • {
              (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
              (input: string | URL | Request, init?: RequestInit): Promise<Response>;
          }
            • (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>

        • FetchTransportOptions

      Returns FetchTransport

    Methods

    • Send a request via the native fetch() API.

      Validates and sanitizes headers to prevent injection attacks. Handles accept-encoding stripping, body attachment with Node.js duplex workaround, and normalizes the response into a RawResponse.

      Parameters

      Returns Promise<RawResponse>

      Raw response from the server