-
Notifications
You must be signed in to change notification settings - Fork 138
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
url encoding for arrays #52
Comments
hey @jurrack, can you describe how you expect them to be serialized? The reason why it is implemented in that way are nested hashes or arrays. Also in case you are working with rails or rack there is something you can do about it: http://rubydoc.info/gems/typhoeus/0.6.3/frames/Rack/Typhoeus/Middleware/ParamsDecoder. |
Hi @i0rek , I would expect them to be serialized as : ?my_array[]=1&my_array[]=2&...&my_array[]=n or ?my_array=1&my_array=2&...&my_array=n I just overloaded Ethon::Easy::Queryable to my needs. |
@jurrack You could add a config variable for it and use it to decide what to do. Do you want to take a stab at it? |
Can anyone share a bit more detailed insights on how to implement this? @jurrack Could you please share your code overriding Ethon::Easy::Queryable? Thank you in advance! |
It should be as simple as changing this line to: key = prefix |
closing for now. |
typhoeus/typhoeus#320 We were seeing array params tranformed into the following: /event?groups[0]=open-forum&groups[1]=armory-films but we need the client to send array params to various API services in the following (valid) format: /event?groups[]=open-forum&groups[]=armory-films
Hi,
recently I had some problems with your encoding of arrays in the query params.
While adding an index in the brackets is a nice idea to make sure the array will be sorted correctly. But most it seems to break with the W3C suggestion (http://www.w3.org/TR/url/#collect-the-url-parameters) and implementation in some frameworks.
An option for setting the array encoding would be nice. So you could enable or disable this feature.
Best regards
Steffen
P.S.: Thanks for building Typhoeus.
The text was updated successfully, but these errors were encountered: