Skip to main content
Skip to main content

Client

Properties

axiosClientAxiosInstanceRequired
configConfigRequired

Methods

createClient

Creates the axios client used for requests As part of the creation, we configure the retry conditions and the exponential backoff approach.

Parameters

configConfigRequired
user supplied configurations

Returns

AxiosInstanceAxiosInstanceRequired

normalizeHeader

Parameters

headerstringRequired

Returns

stringstring

normalizeHeaders

Parameters

objobjectRequired

Returns

RecordRecord<string, any>Required

request

Axios request

Parameters

methodRequestMethodRequired
request method
pathstringRequired
request path
payloadRecord<string, any>Required
request payload

Default: {}

optionsRequestOptionsRequired
axios configuration

Default: {}

customHeadersRecord<string, any>Required
custom request headers

Default: {}

Returns

PromisePromise<any>Required

requiresAuthentication

Parameters

pathanyRequired
methodanyRequired

Returns

booleanboolean

setHeaders

Creates all the initial headers. We add the idempotency key, if the request is configured to retry.

Parameters

userHeadersRequestOptionsRequired
user supplied headers
methodRequestMethodRequired
request method
pathstringRequired
request path
customHeadersRecord<string, any>Required
user supplied headers

Default: {}

Returns

AxiosRequestHeadersRecord<string, string>Required

shouldRetryCondition

Parameters

errAxiosError<any, any>Required
numRetriesnumberRequired
maxRetriesnumberRequired

Returns

booleanboolean
Was this section helpful?