How to intentionally cause a 400 Bad Request in Python/Flask?
问题 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. My application (Python/Flask) logs don't seem to be capturing this, and neither do my webserver/Nginx logs. Edit: I would like to try to cause a 400 bad request in Flask for debugging purposes. How can I do this? Following James advice, I added something similar to the following: @app.route('/badrequest400') def bad_request(): return abort(400)