• Perform a request to an arbitrary path on the configured endpoint.

    If the client has an access token configured, it will be sent in the Authorization header.

    Note: This currently assumes the response body will always contain JSON.

    Parameters

    • client: Apiv2Client

      The client to get the endpoint and other configuration from.

    • method: string

      The request method.

    • path: string

      The path to request.

    • opts: { body?: DocumentType; headers?: Record<string, string> } = {}

      Optional parameters.

      • Optionalbody?: DocumentType

        The request body.

      • Optionalheaders?: Record<string, string>

        Headers to add to the request.

    Returns Promise<unknown>

    A promise resolving with the decoded response.