@metreeca/http - v0.1.1
    Preparing search index...

    Function transport

    • Creates a middleware routing exchanges through a given fetch implementation.

      Supplies the transport a client is to run on, for instance a proxy-bound undici fetch, a platform service binding, or a test double, in place of the standard function createFetch would otherwise delegate to:

      const client = createFetch(basic("user", "secret"), success(), transport(custom));
      

      Ignores the Fetch implementation it wraps, delegating every exchange to fetch instead: middlewares declared before it process exchanges as usual, while middlewares declared after it are never reached, so this middleware is to be declared last in a chain.

      Parameters

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

        The Fetch implementation to route every exchange through

          • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
          • Parameters

            • input: RequestInfo | URL
            • Optionalinit: RequestInit

            Returns Promise<Response>

          • (input: string | Request | URL, init?: RequestInit): Promise<Response>
          • Parameters

            • input: string | Request | URL
            • Optionalinit: RequestInit

            Returns Promise<Response>

      Returns Middleware

      A Middleware delegating every exchange to fetch, ignoring the Fetch implementation it wraps