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

Inproper encoding of [] and nil in query params #219

Closed
kikonen-fiksu opened this issue Oct 22, 2014 · 2 comments
Closed

Inproper encoding of [] and nil in query params #219

kikonen-fiksu opened this issue Oct 22, 2014 · 2 comments

Comments

@kikonen-fiksu
Copy link

For example, following params

{
  foo: [1, 2],
  bar: nil
}

Expected encoding for these is:

"foo[]=1&foo[]=2&bar"

However, HTTPClient encodes it as

"foo=2&bar="

Notice lost value and "=" after bar.

@kikonen-fiksu
Copy link
Author

Partial workaround in Rails env seems to be "params.to_query", which is still, however not dealing null case approriately.

I.e. That null case causes nasty inconsistency between json and query encoding

@nahi
Copy link
Owner

nahi commented Oct 23, 2014

I understand your situation. Please join the discussion at #183

@nahi nahi closed this as completed Oct 23, 2014
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

2 participants