Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setSearch - Duplicate values in array #358

Closed
rudovjan opened this issue Sep 26, 2017 · 2 comments
Closed

setSearch - Duplicate values in array #358

rudovjan opened this issue Sep 26, 2017 · 2 comments
Labels

Comments

@rudovjan
Copy link

Hello there!

I was trying to do something like this

new URI('foo').addSearch('a', [1, 1]).toString()

I was expecting two 'a' in URL, but what I got is

Got

new URI('foo').addSearch('a', [1, 1]).toString()
"foo?a=1"

Expected

new URI('foo').addSearch('a', [1, 1]).toString()
"foo?a=1&a=1"

Did I miss something?

@rodneyrehm
Copy link
Member

You're looking for the URI.duplicateQueryParameters option or URI().duplicateQueryParameters() method described in URI.buildQuery()

@rudovjan
Copy link
Author

Thank you very much! It helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants