HTTP and WebSocket user-agent.

Hierarchy

Constructors

Properties

baseURL: undefined | string | URL

Base URL to be used to resolve all relative request URLs with.

cookieJar: null | CookieJar = ...

Cookie jar to use.

hooks: AsyncHooks = ...

User-agent hooks.

httpTransport: HTTPTransport = ...

Transport backend to perform HTTP requests with.

httpsTransport: HTTPSTransport = ...

Transport backend to perform HTTPS requests with.

maxRedirects: number

Maximum number of redirects to follow, default to 0.

name: undefined | string

Name of user-agent to send with User-Agent header.

wsTransport: WSTransport = ...

Transport backend to use for WebSocket connections.

Methods

  • Returns Promise<void>

  • Parameters

    Returns Promise<Record<string, any>>

  • Parameters

    • values: Record<string, string | Upload> = {}

    Returns FormData

  • Add a hook to extend the user-agent.

    Parameters

    • name: string
    • fn: UserAgentHook

    Returns UserAgent

  • Destroy all active keep-alive connections.

    Returns Promise<void>

Generated using TypeDoc