File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ export interface ParamEncoder {
122122 ( value : any , defaultEncoder : ( value : any ) => any ) : any ;
123123}
124124
125+ export interface CustomParamsSerializer {
126+ ( params : Record < string , any > , options ?: ParamsSerializerOptions ) : string ;
127+ }
128+
125129export interface ParamsSerializerOptions extends SerializerOptions {
126130 encode ?: ParamEncoder ;
127131}
@@ -134,7 +138,7 @@ export interface AxiosRequestConfig<D = any> {
134138 transformResponse ?: AxiosResponseTransformer | AxiosResponseTransformer [ ] ;
135139 headers ?: AxiosRequestHeaders ;
136140 params ?: any ;
137- paramsSerializer ?: ParamsSerializerOptions ;
141+ paramsSerializer ?: ParamsSerializerOptions | CustomParamsSerializer ;
138142 data ?: D ;
139143 timeout ?: number ;
140144 timeoutErrorMessage ?: string ;
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ Axios.prototype.request = function request(configOrUrl, config) {
5959 } , false ) ;
6060 }
6161
62+ var paramsSerializer = config . paramsSerializer ;
63+
64+ utils . isFunction ( paramsSerializer ) && ( config . paramsSerializer = { serialize : paramsSerializer } ) ;
65+
6266 // filter out skipped interceptors
6367 var requestInterceptorChain = [ ] ;
6468 var synchronousRequestInterceptors = true ;
You can’t perform that action at this time.
0 commit comments