- jsonify的代码示例
from flask import Flask,render_template,jsonify
app=Flask(__name__)
@app.route('/')
def get_json():
data = {"name":"zeng", "age":23}
return jsonify(data)
if __name__ == '__main__':
app.run(port=2021,host="127.0.0.1",debug=True)