Ruby on Rails Saturday, December 29, 2018



On Saturday, December 29, 2018 at 5:48:31 AM UTC-5, Colin Law wrote:
On Sat, 29 Dec 2018 at 10:36, fugee ohu <fuge...@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

 It's not clear to me what the response is Can the problem be that my request is the full url with callback and other query string data Should I just be calling the script without invoking the Struts framework callback but still provide the item number as query string data

--
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/2d084e6e-dcb5-4cd7-a571-8873434d3f0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment