Convert unicode json to normal json in python

后端 未结 4 1267
谎友^
谎友^ 2020-12-19 02:28

I got the following json: {u\'a\': u\'aValue\', u\'b\': u\'bValue\', u\'c\': u\'cValue\'} by doing request.json in my python code. Now, I want to c

4条回答
  •  佛祖请我去吃肉
    2020-12-19 02:52

    For python 2.x

    import yaml
    import json
    json_data = yaml.load(json.dumps(request.json()))
    

    Now this json_data can be used as a json and can have list of json as well.

提交回复
热议问题