TypeError: the JSON object must be str, not 'bytes'

冷不防 2022-07-13 09:28 172阅读 0赞
  1. story_data = json.loads(self.request.body)

提示TypeError: the JSON object must be str, not ‘bytes’
改为

  1. story_data = json.loads(self.request.body.decode('utf-8'))

就好了

发表评论

表情:
评论列表 (有 0 条评论,172人围观)

还没有评论,来说两句吧...

相关阅读