return jsonify flask code example
Example 1: flask import jsonify
from flask import jsonify
@app.route('/_get_current_user')
def get_current_user():
return jsonify(username=g.user.username,
email=g.user.email,
id=g.user.id)
Example 2: how to return json response in flask
from flask import jsonify
@app.route('/summary')
def summary():
d = make_summary()
return jsonify(d)