This is my code for sending data:
@app.route('/testColoring')
def testColoring():
...
return jsonify({'image_url': imgPath})
However, I would like to send it as a Response object, because I want to set the headers to disable cache. Something like this:
response = make_response()
response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate'
response.headers['Pragma'] = 'no-cache'
At first, I thought it would be response.data, but according to the flask API documentation it should not be used and it will be deprecated.
Please advise on how I could combine response and json data, or other possible solutions. Thanks.