route-parser icon indicating copy to clipboard operation
route-parser copied to clipboard

Support Array Parameters

Open icirellik opened this issue 9 years ago • 3 comments

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?

icirellik avatar Oct 05 '15 18:10 icirellik

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?

rcs avatar Oct 08 '15 01:10 rcs

@rcs -

Perhaps using qs library?

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

Marak avatar Nov 02 '15 00:11 Marak

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

Both should be supported, as both are widely used.

CezaryDanielNowak avatar Nov 03 '15 22:11 CezaryDanielNowak