rcs / route-parser

An isomorphic, bullet-proof, ninja-ready route parsing, matching, and reversing library for Javascript in Node and the browser.
MIT License
349 stars 35 forks source link

Support Array Parameters #8

Open icirellik opened 8 years ago

icirellik commented 8 years ago

I'm having trouble with url's that have arrays as parameters.

/users?userIds=1&userIds=2

Is this form supported / is there any intention of adding it in the future?

rcs commented 8 years ago

It's currently a weird artifact that query parameters are supported here at all.

I'd love to give them some first class support. I haven't started doing the research yet, are there existing APIs you think win in query-param-parsing arena?

Marak commented 8 years ago

@rcs -

Perhaps using qs library?

https://www.npmjs.com/package/qs

CezaryDanielNowak commented 8 years ago

There is also another approach to arrays in address: /users?userIds[]=1&userIds[]=2

Both should be supported, as both are widely used.