axios#AxiosResponseHeaders TypeScript Examples
The following examples show how to use
axios#AxiosResponseHeaders.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: selling-partner-api-errors.ts From selling-partner-api-sdk with MIT License | 5 votes |
public constructor(error: ModelError, headers: AxiosResponseHeaders) {
super(error.details)
this.code = error.code
this.message = error.message
this.details = error.details
this.requestId = headers['x-amzn-RequestId'] || headers['x-amzn-requestid'] || ''
}
Example #2
Source File: selling-partner-api-errors.ts From selling-partner-api-sdk with MIT License | 5 votes |
public constructor(error: ModelError, headers: AxiosResponseHeaders) {
super(error, headers)
this.rateLimit =
Number(headers['x-amzn-RateLimit-Limit']) ||
Number(headers['x-amzn-ratelimit-limit']) ||
undefined
}
Example #3
Source File: KubeconfigDownload.tsx From assisted-ui-lib with Apache License 2.0 | 5 votes |
getKubeconfigFileName = (headers: AxiosResponseHeaders) => {
const fileNameMatch =
headers['content-disposition'] && headers['content-disposition'].match(/filename=".*"/);
return fileNameMatch ? fileNameMatch[0].slice(10, -1) : 'kubeconfig';
}