json.loads doesn't work with binary JSON posted by AngularJS in Python

后端 未结 1 1526
梦如初夏
梦如初夏 2021-01-27 11:53

I am coding in Django and my front-end uses Angularjs like this:

In controller.js

$scope.reserve = {
    reserve: {
        duration: {
            sta         


        
相关标签:
1条回答
  • 2021-01-27 12:25

    In Python 3, you need to decode the bytes into a string before you can load the json.

    json.loads(request.body.decode('utf-8'))
    
    0 讨论(0)
提交回复
热议问题