Axios has recently done a major upgrade and starting by its version 1.x I am unable to correctly introduce my own parameter serializer to it.
I used to do it as follows:
axios.defaults.paramsSerializer = params => qs.stringify(params, { arrayFormat: 'ma', encode: false });
Now the definition of paramsSerializer is changed to the following:
axios.defaults.paramsSerializer = {
indexes: null,
encode: ...
}
Does anyone know how I can assign my serializer to it considering the new definition?
Axios has recently done a major upgrade and starting by its version 1.x I am unable to correctly introduce my own parameter serializer to it.
I used to do it as follows:
axios.defaults.paramsSerializer = params => qs.stringify(params, { arrayFormat: 'ma', encode: false });
Now the definition of paramsSerializer is changed to the following:
axios.defaults.paramsSerializer = {
indexes: null,
encode: ...
}
Does anyone know how I can assign my serializer to it considering the new definition?
Share Improve this question asked Oct 11, 2022 at 9:02 AlexAlex 1,0462 gold badges15 silver badges31 bronze badges1 Answer
Reset to default 7I was facing the same issue, and this ment helps me a lot https://github./axios/axios/issues/5058#issuement-1272107602
Hope you find it useful