Skip to content

Instantly share code, notes, and snippets.

@alinasrullayev
Forked from hirobert/flask_abort_example.py
Created September 10, 2021 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alinasrullayev/76fd1f76d0ee25fb07bbb9f6d6f87f5e to your computer and use it in GitHub Desktop.
Save alinasrullayev/76fd1f76d0ee25fb07bbb9f6d6f87f5e to your computer and use it in GitHub Desktop.
flask abort as json
from flask import abort, make_response, jsonify
abort(make_response(jsonify(message="Message goes here"), 400))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment