0👍
Try this:
@app.route('/data', methods=["GET", "POST"])
def data():
data = [time() * 1000, random() * 100]
response = make_response(json.dumps(data))
response.content_type = 'application/json'
return response
I use it in my app and it works.
Source:stackexchange.com