Sinch Node.js SDK - v1.9.0
    Preparing search index...

    Class SinchHttpClient

    Low-level HTTP client to call any Sinch API, including the endpoints not covered by the SDK.

    The SDK takes care of the authentication (OAuth2 with keyId and keySecret first, else the SMS API token or the application signing), the rate-limit retries, the timeout and the User-Agent header. useSinchAuth: false, on the client or on a call, sends the request without any authentication. The URL, query string, headers and body are sent as provided: no path or query encoding, no field renaming, no pagination.

    Any response with a status >= 400 is thrown as an ApiHttpError.

    Index

    Constructors

    Methods

    • Send a PATCH request.

      Parameters

      • url: string

        Absolute URL, without query parameters

      • Optionalbody: HttpBody

        Body (e.g. a JSON string), if any: the content-type header is then required

      • Optionalparams: HttpCallParameters

        Query string, headers and request-level options

      Returns Promise<HttpResponse>

    post

    • post(
          url: string,
          body?: HttpBody,
          params?: HttpCallParameters,
      ): Promise<HttpResponse>

      Send a POST request.

      Parameters

      • url: string

        Absolute URL, without query parameters

      • Optionalbody: HttpBody

        Body (e.g. a JSON string), if any: the content-type header is then required

      • Optionalparams: HttpCallParameters

        Query string, headers and request-level options

      Returns Promise<HttpResponse>

    • Send a POST request with a multipart/form-data body. The content-type header (with its boundary) is set by the SDK.

      Parameters

      • url: string

        Absolute URL, without query parameters

      • form: HttpFormData

        Form fields, as a form-data instance or a record. Streams are not supported.

      • Optionalparams: HttpCallParameters

        Query string, headers and request-level options

      Returns Promise<HttpResponse>

    • Send a PUT request.

      Parameters

      • url: string

        Absolute URL, without query parameters

      • Optionalbody: HttpBody

        Body (e.g. a JSON string), if any: the content-type header is then required

      • Optionalparams: HttpCallParameters

        Query string, headers and request-level options

      Returns Promise<HttpResponse>