An interface to provide implementation-specific, asyncronous http calls. This driver provides default implementations for common environments. Users can configure the Client to use custom implementations if desired.

interface HTTPClient {
    close(): void;
    request(req: HTTPRequest): Promise<HTTPResponse>;
}

Implemented by

Methods

Methods

  • Flags the calling Client as no longer referencing this HTTPClient. Once no Client instances reference this HTTPClient the underlying resources will be closed. It is expected that calls to this method are only made by a Client instantiation. The behavior of direct calls is undefined.

    Returns void

    For some HTTPClients, such as the FetchClient, this method is a no-op as there is no shared resource to close.