1
- import type { AxiosRequestHeaders , AxiosStatic } from 'axios'
1
+ import { AxiosRequestHeaders } from 'axios'
2
+ import type { AxiosStatic } from 'axios'
2
3
import copy from 'fast-copy'
3
- import qs from 'qs'
4
4
import asyncToken from './async-token'
5
5
6
6
import rateLimitRetry from './rate-limit'
@@ -16,7 +16,7 @@ const HOST_REGEX = /^(?!\w+:\/\/)([^\s:]+\.?[^\s:]+)(?::(\d+))?(?!:)$/
16
16
* @private
17
17
* @param {AxiosStatic } axios - Axios library
18
18
* @param {CreateHttpClientParams } options - Initialization parameters for the HTTP client
19
- * @return {ContentfulAxiosInstance } Initialized axios instance
19
+ * @return {AxiosInstance } Initialized axios instance
20
20
*/
21
21
export default function createHttpClient (
22
22
axios : AxiosStatic ,
@@ -41,7 +41,6 @@ export default function createHttpClient(
41
41
httpsAgent : false as const ,
42
42
timeout : 30000 ,
43
43
throttle : 0 ,
44
- proxy : false as const ,
45
44
basePath : '' ,
46
45
adapter : undefined ,
47
46
maxContentLength : 1073741824 , // 1GB
@@ -90,11 +89,6 @@ export default function createHttpClient(
90
89
headers : config . headers ,
91
90
httpAgent : config . httpAgent ,
92
91
httpsAgent : config . httpsAgent ,
93
- paramsSerializer : {
94
- serialize : ( params ) => {
95
- return qs . stringify ( params , { arrayFormat : 'repeat' } )
96
- } ,
97
- } ,
98
92
proxy : config . proxy ,
99
93
timeout : config . timeout ,
100
94
adapter : config . adapter ,
@@ -106,6 +100,7 @@ export default function createHttpClient(
106
100
requestLogger : config . requestLogger ,
107
101
retryOnError : config . retryOnError ,
108
102
}
103
+
109
104
const instance = axios . create ( axiosOptions ) as AxiosInstance
110
105
instance . httpClientParams = options
111
106
@@ -116,8 +111,8 @@ export default function createHttpClient(
116
111
* and the version of the library comes from different places depending
117
112
* on whether it's a browser build or a node.js build.
118
113
* @private
119
- * @param {CreateHttpClientParams } httpClientParams - Initialization parameters for the HTTP client
120
- * @return {ContentfulAxiosInstance } Initialized axios instance
114
+ * @param {CreateHttpClientParams } newParams - Initialization parameters for the HTTP client
115
+ * @return {AxiosInstance } Initialized axios instance
121
116
*/
122
117
instance . cloneWithNewParams = function (
123
118
newParams : Partial < CreateHttpClientParams >
0 commit comments