I’m trying to retrieve some data from the FaceBook graph API. The API URL returns the following string:
access_token=AAABBBB&expires=5173539
The following Python code throws a ValueError: No JSON object could be decoded on the 4th line:
import json
import urllib2
data = urllib2.urlopen(url).read()
jdata = json.loads(data)
print jdata.access_token
If this is the actual body of the API response:
That’s not JSON. It’s just a query string, much like a GET request, and will need to be parsed in another way.