For some reason, I am not getting a json as my response. What am I doing wrong? I want to be able to get the result dict when I call the post function but all I am getting back is a 200 status code indicating everything is ok.
@app.route('/data', methods=['POST'])
def data():
if request.method == "POST":
result = {
"data": {
"name": "First, Last",
"value": 1
}
}
return Response(json.dumps(result), mimetype='application/json; charset=utf-8')
else:
abort(404)
I have tried different ways to return the json obect:
return json.dumps(result)
return jsonify(result)
But nothing works :\