undefined method 'parse'

28 views
Skip to first unread message

Elijah Lucian

unread,
Apr 3, 2018, 12:13:42 PM4/3/18
to http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
why am I getting this error message? is this not the method to use on the response.body?

I am trying to get back a hash from a JSON api.

Tony Arcieri

unread,
Apr 3, 2018, 12:23:12 PM4/3/18
to Elijah Lucian, http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
Can you post a full backtrace?

On Tue, Apr 3, 2018 at 9:13 AM Elijah Lucian <elijah...@gmail.com> wrote:
why am I getting this error message? is this not the method to use on the response.body?

I am trying to get back a hash from a JSON api.

--
You received this message because you are subscribed to the Google Groups "http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to httprb+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Tony Arcieri

Aleksey Zapparov

unread,
Apr 3, 2018, 12:32:34 PM4/3/18
to Elijah Lucian, http.rb: a fast, easy-to-use Ruby HTTP client with a chainable API
Response body does not have parse method. It represents body. Which is just stream of data.

You need to call parse on (!) response object.

On Tue, 3 Apr 2018, 18:13 Elijah Lucian, <elijah...@gmail.com> wrote:
why am I getting this error message? is this not the method to use on the response.body?

I am trying to get back a hash from a JSON api.

--
Reply all
Reply to author
Forward
0 new messages