Client is responsible for making HTTP requests to a specified base URL.

This class provides methods for performing GET and POST requests, handling request options, headers, and responses. It abstracts the underlying HTTPS request handling and provides a simple interface for interacting with APIs.

The base URL for all API requests.

Optional default headers to include in every request.

Hierarchy (View Summary)

Constructors

Methods

Constructors

Methods

  • Type Parameters

    • T

    Parameters

    • path: string
    • Optionalparams: string | Record<string, string> | URLSearchParams
    • Optionalopts: RequestOptions

    Returns Promise<T>

  • Type Parameters

    • T

    Parameters

    • path: string
    • Optionaldata: unknown
    • Optionalopts: RequestOptions

    Returns Promise<T>