Clarification on paramsSerializer option #4883
-
Can anyone provide additional information about the updated paramsSerializer option? I have a fairly simple use case, where I need a query string with duplicate keys converted from an array value in an object, ie someurl.com?arr=1&arr=2. I've seen this same issue scattered around the docs and discussions, with others bemoaning brackets that appear in a query string. I am under the impression that setting paramsSerializer to {indexes: null} should correct this issue. Is this correct? If so, what are the reasons that I might be running into errors? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, this is correct for Axios v1.0.0-alpha.1 axios.post("https://httpbin.org/post", data, {
params: {
foo: "bar",
arr: [1, 2, 3]
},
paramsSerializer: {
indexes: null
}
}); Resolved query string:
Summary:
|
Beta Was this translation helpful? Give feedback.
Yes, this is correct for Axios v1.0.0-alpha.1
Resolved query string:
Playground
Summary: