[Fixed]-How to do JSON handler in Django

32👍

Most web framework consider string representation as utf-8, so bytes in Python 3 (like Django, and Pyramid). In python3 needs to decode(‘utf-8’) for body in:

req = json.loads( request.body.decode('utf-8') )

5👍

json_data = json.loads(request.read().decode('utf-8'))

worked for me

Leave a comment