An interface to provide implementation-specific, asynchronous 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<T>(req: HTTPRequest<T>): 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.