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

Parameters with the same key #15

Open
nderkach opened this issue Mar 9, 2014 · 4 comments
Open

Parameters with the same key #15

nderkach opened this issue Mar 9, 2014 · 4 comments

Comments

@nderkach
Copy link

nderkach commented Mar 9, 2014

Currently, as we store parameters in a dictionary there is now way to provide parameters with the same name, i.e. &bucket=id:seatgeek&bucket=id:songkick

Then, the questions is how to specify such case within constrains of a dictionary. You could do it via an array as a value: @"bucket": @[@"id:seatgeek", @"id:songkick"]

I don't have a better idea for now. I have a patch available with this implementation if you are ok with it.

@subnetmarco
Copy link
Member

If you could submit the patch, I'd be happy to merge it. Could you also provide a test case?

@thibaultcha
Copy link
Member

@nderkach With HTTP, wouldn't the proper way to handle that would be to specify that the bucket parameter is an array?

&bucket[]=id:seatgeek&bucket[]=id:songkick

Otherwise I'm not sure webservers would be able to handle that parameter. Is this what you are talking about?

@subnetmarco
Copy link
Member

@thibaultcha @nderkach Sometimes the param[]=value&param[]=value notation is used for arrays, while I've seen scenarios of arrays specified with param=value&param=value as well.

@derwaldgeist
Copy link

derwaldgeist commented Dec 28, 2019

I am using this workaround, which is also valid URL syntax for ordered arrays:

param[0]=value&param[1]=value

and works with the NSDictionary.

It's weird that this library does not support array parameters.

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

No branches or pull requests

4 participants