Class HttpClient

Handle HTTP requests with a uniform interface.

Hierarchy

  • HttpClient

Constructors

Properties

DEFAULT_REQUEST: {
    method: string;
    rejectUnauthorized: boolean;
    requestApi: string;
    resolveWithFullResponse: boolean;
} = ...

Type declaration

  • method: string
  • rejectUnauthorized: boolean
  • requestApi: string
  • resolveWithFullResponse: boolean
DEFAULT_TIMEOUT: number = 60000
HTTPS_AGENT: any
HTTP_AGENT: any
MAX_REQUESTS_PER_SECOND: number = 50
MAX_TIMEOUT: number = 2147483647
PROMISE_THROTTLES: any[] = []
TASK_QUEUES: any[] = []
digestAuthRequest: ((method, url, username, password) => void) = ...

Type declaration

Methods

  • Get a singleton instance of an HTTP client to share.

    Returns any

    a shared agent for network requests among library instances

  • Get a singleton instance of an HTTPS client to share.

    Returns any

    a shared agent for network requests among library instances

  • Parameters

    • headersStr: any

    Returns {}

    • Make a HTTP request.

      Parameters

      • request: any

        configures the request to make

      Returns Promise<any>

      response - the response object

    • Parameters

      • req: any

      Returns Promise<any>

    • Parameters

      • req: any

      Returns Promise<any>

    Generated using TypeDoc