Python Flask Intentional Empty Response -
is there way homecoming response (from make_response() object or similar) properties doesn't render page 1 time again , doesn't else either. trying run code on server without generating output
a simple 'return none' produces:
valueerror: view function did not homecoming response
this should possible because next downloads file , doesn't render template:
mystring = "first line of document" response = make_response(mystring) response.headers["content-disposition"] = "attachment; filename=myfile.txt" homecoming response
any help appreciated!
you responding request, http server must homecoming something. http 'empty response' response 204 no content
:
return ('', 204)
note returning file browser not empty response, different html response.
python flask response
No comments:
Post a Comment