lostisland / sawyer

Secret User Agent of HTTP
MIT License
247 stars 75 forks source link

How can I encode the following hash in my query in Ruby with Sawyer? #41

Closed volkanunsal closed 9 years ago

volkanunsal commented 9 years ago

The encoding method of this library is killing me. I have a data structure like this:

{paths: [['location', 'ohana-1']]}

Yes, that's an array in an array. Currently it's encoded into JSON like this:

{'paths[][]': [ 'location', 'ohana-1' ] }

Expected encoding:

{paths: [['location', 'ohana-1']]}

Is there any hope here?

volkanunsal commented 9 years ago

Btw, the above is just for the query. But I have a similar problem when I try to send the data in the body with a POST request.

{ '{"paths":["locations",{"from":0,"to":20}]}': ""}