Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lexical error: invalid char in json text #186

Open
Sunil1993 opened this issue May 23, 2018 · 0 comments
Open

lexical error: invalid char in json text #186

Sunil1993 opened this issue May 23, 2018 · 0 comments

Comments

@Sunil1993
Copy link

Trying to parse large json files using yajl.

The code is working great in my local system. But when deployed in production I am getting 400 HTTP bad request. The file is coming from amazon s3.

Not sure of the exact issue here. Is it because of some authentication or wrong credentials?

Code:

require 'yajl'
require 'yajl/deflate'
require 'yajl/http_stream'
require 'uri'

uri = URI.parse(<amazon s3 link>)
hash = Yajl::HttpStream.get(uri, { headers: {"Content-Type" => "application/json", "Accept" => "application/json"}}) 

Error:

Yajl::ParseError: lexical error: invalid char in json text.
          "2018-01-08T16:04:38Z"   } ] HTTP/1.1 400 Bad Request  Date:
                     (right here) ------^

Any help would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant