A consumer of my REST API says that on occasion I am returning a 400 Bad Request - The request sent by the client was syntactically incorrect. error.>
400 Bad Request
The request sent by the client was syntactically incorrect.
You can use abort to raise an HTTP error by status code.
abort
from flask import abort @app.route('/badrequest400') def bad_request(): abort(400)