Skip to main content

clients/http/index

@prismatic-io/spectral"clients/http/index"

Index#

Interfaces#

Type aliases#

Functions#

Type aliases#

HttpClient#

Ƭ HttpClient: AxiosInstance

Defined in packages/spectral/src/clients/http/index.ts:11


SendRawRequestValues#

Ƭ SendRawRequestValues: ActionInputParameters‹typeof inputs›

Defined in packages/spectral/src/clients/http/index.ts:137

Functions#

Const buildRawRequestAction#

buildRawRequestAction(baseUrl: string, label: string, description: string): ActionDefinition‹object, boolean, object›

Defined in packages/spectral/src/clients/http/index.ts:179

Parameters:

NameTypeDefault
baseUrlstring-
labelstring"Raw Request"
descriptionstring"Issue a raw HTTP request"

Returns: ActionDefinition‹object, boolean, object›


Const computeRetryDelay#

computeRetryDelay(retryDelay: RetryConfig["retryDelay"], useExponentialBackoff: RetryConfig["useExponentialBackoff"]): IAxiosRetryConfig["retryDelay"]

Defined in packages/spectral/src/clients/http/index.ts:66

Parameters:

NameType
retryDelayRetryConfig["retryDelay"]
useExponentialBackoffRetryConfig["useExponentialBackoff"]

Returns: IAxiosRetryConfig["retryDelay"]


Const createClient#

createClient(__namedParameters: object): HttpClient

Defined in packages/spectral/src/clients/http/index.ts:88

Parameters:

__namedParameters: object

NameTypeDefault
baseUrlundefined | string-
debugbooleanfalse
headersundefined | object-
paramsundefined | object-
responseTypeundefined | "text" | "arraybuffer" | "blob" | "document" | "json" | "stream"-
retryConfigundefined | RetryConfig‹›-
timeoutundefined | number-

Returns: HttpClient


Const handleErrors#

handleErrors(error: unknown): unknown

Defined in packages/spectral/src/clients/http/index.ts:126

Parameters:

NameType
errorunknown

Returns: unknown


Const sendRawRequest#

sendRawRequest(baseUrl: string, values: SendRawRequestValues, authorizationHeaders: Record‹string, string›): Promise‹AxiosResponse›

Defined in packages/spectral/src/clients/http/index.ts:139

Parameters:

NameTypeDefault
baseUrlstring-
valuesSendRawRequestValues-
authorizationHeadersRecord‹string, string›{}

Returns: Promise‹AxiosResponse›


Const toAuthorizationHeaders#

toAuthorizationHeaders(connection: Connection): object

Defined in packages/spectral/src/clients/http/index.ts:13

Parameters:

NameType
connectionConnection

Returns: object

  • Authorization: string

Const toAxiosRetryConfig#

toAxiosRetryConfig(__namedParameters: object): IAxiosRetryConfig

Defined in packages/spectral/src/clients/http/index.ts:76

Parameters:

__namedParameters: object

NameType
restrest
retryAllErrorsundefined | false | true
retryConditionundefined | function
retryDelayundefined | number | function
useExponentialBackoffundefined | false | true

Returns: IAxiosRetryConfig


Const toFormData#

toFormData(formData: KeyValuePair‹unknown›[], fileData: KeyValuePair‹unknown›[]): FormData

Defined in packages/spectral/src/clients/http/index.ts:38

Parameters:

NameType
formDataKeyValuePair‹unknown›[]
fileDataKeyValuePair‹unknown›[]

Returns: FormData