Allow PHP-style serialization of array query parameters
SeinopSys opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
I'm trying to construct a query string from an array using query
but it seems like I get the JavaScript default join behavior: keys=a,b
Describe the solution you'd like
Calling query
with { keys: ['a', 'b'] }
(and possibly a second options parameter to control this?) should result in "keys[]=a&keys[]=b"
Describe alternatives you've considered
Since query
expects an object the only way to get around this is to wrap it in another function that pulls array keys out of the params object and maps them separately then concatenates the result with query
's.
Additional context
I'm making an API request to a PHP backend that uses this URL syntax for receiving array values.
@SeinopSys we are currently working on this feature and it will be released in the next major version.
Thank you for your interest in the project! I'm closing this issue now but if you have any further questions, feel free to add more comments.