Last active
August 29, 2015 14:10
-
-
Save debovis/5e3e8bb4e1d748d0ee9e to your computer and use it in GitHub Desktop.
Python Flask return JSON Response Exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json_headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} | |
res = Response(headers=json_headers) | |
res.set_data(data) | |
res.status_code = 400 | |
raise abort(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment