First what you want to do is enable debug mode so Flask will actually tell you what the error is. (And you get the added benefit of flask reloading every time you modify your code!)
if __name__ == '__main__':
app.debug = True
app.run()
Then we find out our error:
TypeError: 'dict' object is not callable
You’re returning request.json, which is a dictionary. You need to convert it into a string first. It’s pretty easy to do:
def api_response():
from flask import jsonify
if request.method == 'POST':
return jsonify(**request.json)
There you are! 🙂