4
4
* This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
5
5
*/
6
6
7
- import axios , { AxiosInstance , AxiosRequestConfig , AxiosResponse } from 'axios' ;
7
+ import axios , { AxiosHeaders , AxiosInstance , AxiosRequestConfig , AxiosResponse } from 'axios' ;
8
8
import isNode from 'detect-node' ;
9
9
import FormData from 'form-data' ;
10
10
import { isBlob } from '../apiHelper' ;
91
91
}
92
92
93
93
newRequest . data = form ;
94
- mergeHeaders ( newRequest . headers || { } , form . getHeaders ( ) ) ;
94
+ mergeHeaders ( newRequest . headers as AxiosHeaders || { } , form . getHeaders ( ) ) ;
95
95
} else if (
96
96
requestBody ?. type === 'form-data' ||
97
97
requestBody ?. type === 'form'
98
98
) {
99
99
// Create form-urlencoded request
100
100
setHeader (
101
- newRequest . headers || { } ,
101
+ newRequest . headers as AxiosHeaders || { } ,
102
102
CONTENT_TYPE_HEADER ,
103
103
FORM_URLENCODED_CONTENT_TYPE
104
104
) ;
112
112
// Otherwise, use the content type if available.
113
113
contentType = requestBody . content . options . contentType ;
114
114
}
115
- setHeaderIfNotSet ( newRequest . headers || { } , CONTENT_TYPE_HEADER , contentType ) ;
115
+ setHeaderIfNotSet ( newRequest . headers as AxiosHeaders || { } , CONTENT_TYPE_HEADER , contentType ) ;
116
116
newRequest . data = requestBody . content . file ;
117
117
}
118
118
else if ( requestBody && typeof ( requestBody [ 'type' ] ) !== 'undefined' ) {
139
139
public convertHttpResponse ( resp : AxiosResponse ) : HttpResponse {
140
140
return {
141
141
body : resp . data ,
142
- headers : resp . headers ,
142
+ headers : resp . headers as AxiosHeaders ,
143
143
statusCode : resp . status ,
144
144
} ;
145
145
}
185
185
return new AbortError ( 'The HTTP call was aborted.' ) ;
186
186
}
187
187
}
188
-
188
+
0 commit comments