Ruby on Rails Saturday, December 29, 2018

On Sat, 29 Dec 2018 at 10:36, fugee ohu <fugee279@gmail.com> wrote:
>
> json_data = res.body.gsub(/^.+{/, "{").chomp(");")
> json = JSON.parse(json_data)
> JSON::ParserError: 765: unexpected token at '{\"pvid\":\"ff43f2dc-3f86-42a3-bfa8-49c117e9da6a\",\"scm-cnt\":\"1007.13482.95643.0\",

Why have you posted this? You still have \" instead of "
As I said, look again at the spec of what a JSON string should look
like. Until you have that there is no point feeding into parse()

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtiWkvvfSRf42bdJrMri0sTFGojc2teuT2GSAt_f6oQsw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment