Simplejson.scanner.jsondecodeerror: expecting value: line 1 column 1 (char 0)-Fixed
CoderLegion

CoderLegion @coderlegi0n

About: Coder, Python Programmer

Location:
Australia
Joined:
Jan 23, 2020

Simplejson.scanner.jsondecodeerror: expecting value: line 1 column 1 (char 0)-Fixed

Publish Date: May 13 '22
3 0

I am facing error “Expecting value: line 1 column 1 (char 0)” when trying to decode the JSON.The URL I use for a API call works fine in a browser, but gives above error when done through the curl request. The error happens at the return simplejson.loads(response_json)

Solution :
The solution is as below:

· There is no need to use a simplejson library, a same library is included with Python as a json module.

· There is no need to decode the response from a UTF8 to unicode, a simplejson / json .loads() method can handle UTF8 encoded data natively.

Read more here

Comments 0 total

    Add comment