return json and the status code flask python code example
Example 1: how to return json response in flask
from flask import jsonify
@app.route('/summary')
def summary():
d = make_summary()
return jsonify(d)
Example 2: flask return status code 200 and json
return jsonify(data), 200