July 2017
Beginner to intermediate
340 pages
7h 43m
English
When your code does not handle an exception, Flask returns an HTTP 500 response without providing any specific information, like the traceback. Producing a generic error is a safe default behavior to avoid leaking any private information to the users in the error body.
The default 500 response is a simple HTML page along with the right status code:
$ curl http://localhost:5000/api <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>500 Internal Server Error</title> <h1>Internal Server Error</h1> <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
When implementing microservices using JSON, it's a ...
Read now
Unlock full access