Closed tchukuchuk closed 11 years ago
My other problem is that the hash provided is not mutable, and I need to update it to store data with core data. Is it possible to add something like this ?
https://github.com/rubymotion/BubbleWrap/blob/master/motion/core/json.rb#L18
Best regards,
Julien
I have just seen that I can use Elevate::HTTP::Response#raw_body , so I can parse it with BW::JSON.parse :)
Why wouldn't I automatically parse JSON bodies? It all happens in the worker thread anyway.
I use a lot BW::HTTP, and the returned response has a different behaviour especially for JSON. Anyway, I prefer use Response#raw_body instead of Response#body. Thanks for your reply.
The point is to try to improve upon what we have, rather than merely imitating it.
I'll close this issue with the intent of documenting this behavior.
Hello,
I don't understand why you automatically parse JSON response. In fact, I would like to test the returned code (response.code), then call response.body.
https://github.com/mattgreen/elevate/blob/master/lib/elevate/http/response.rb#L34
Best regards,
Julien