Closed ShermanGirl closed 6 years ago
Thanks for pointing this out.
I added the following to the request. I will commit this tomorrow. I'm assuming utf-8. Perhaps I'll update this to check for a charset=something else in the Content-Type header before committing. I'll have to benchmark it since utf-8 should cover most everyone.
@property
def json(self):
if self._json == None:
try:
if self.mime_type == "application/json":
self._json = json.loads(self.body.decode("utf-8"))
except:
pass
return self._json
Committed as above
When running the 3_request.py example I see the json is available from r.body as a byte string. Can we add r.json with it preloaded as an object [1,2,3...] ?