tornado
tornado copied to clipboard
Expose web.RequestHandler._reason
Why? this is handy to have when you are writing custom access loggers and other "on finish" behaviors. I currently rely on handler._reason
which is an internal. It also mirrors web.RequestHandler.get_status
.
I'm hesitant to add anything new related to the reason string because it's been removed in HTTP/2. It's nearly equivalent to do http.client.responses[handler.get_status()]
. The only time it's not equivalent is if you're using a custom reason string, and if you want to use that in logging I think it's better to use a custom field to do it instead of piggybacking on a formerly-standard field that should go away one day.