Type alias HttpFetchAgent

HttpFetchAgent: ((this: void, next: ((this: void, request?: Request) => OnEvent<[Response]>), request: Request) => EventSender<[Response]>)

Type declaration

    • (this: void, next: ((this: void, request?: Request) => OnEvent<[Response]>), request: Request): EventSender<[Response]>
    • HTTP fetch agent signature.

      The agent can be used to alter HttpFetch processing. For that it should be registered in appropriate context.

      All registered agents are organized into chain. The first agent in chain is called by HttpFetch.

      Returns

      An EventSender of response object(s). It is returned either to preceding agent in chain, or as a result of HttpFetch call.

      Parameters

      • this: void
      • next: ((this: void, request?: Request) => OnEvent<[Response]>)

        Either calls the next agent in chain, or actually fetches the data if this agent is the last one. Accepts an optional Request parameter. The original request will be used instead when omitted.

          • (this: void, request?: Request): OnEvent<[Response]>
          • Parameters

            • this: void
            • Optional request: Request

            Returns OnEvent<[Response]>

      • request: Request

        HTTP request.

      Returns EventSender<[Response]>

Generated using TypeDoc