On Saturday, December 29, 2018 at 5:01:03 AM UTC-5, Colin Law wrote:
>
> On Sat, 29 Dec 2018 at 09:37, fugee ohu <fuge...@gmail.com <javascript:>> 
> wrote: 
> > .. 
> >>> JSON::ParserError: 765: unexpected token at 
> '({"success":true,"code":0,"results":[{"productId":32817 
> >> 
> > ... 
> > JSON::ParserError: 765: unexpected token at 
> '{\"pvid\":\"805ba4ee-6446-4148-ab0a-ff5e51c0ab24\",\" 
>
> You have not only taken out the bracket, but you have also changed all 
> the " to \".  Did you not notice that yourself? 
>

> Colin 
>


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\",
 
...
 

-- 
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+unsubscr...@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/cad0f102-e512-43cb-b3f1-c75a800748bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to