from flask import Flask
import json
app = Flask(__name__)
@app.route('/json2')
def demo2():
json_demo = '{"age": 10, "name": "meng", "area": "CHN"}'
# dumps将json转换为字典
result=json.loads(json_demo)
return result
if __name__ == '__main__':
app.run(debug=True)
# 为str
json_demo = '{"age": 10, "name": "meng", "area": "CHN"}'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)