I'm interfacing with an internal logging system and I'd like to obtain the current response's
def request_finished_listener(sender, response):
teardown_request is called as cleanup after the response is generated, it does not have access to the response. You should use the
request_finished signal or
after_request decorator if you need access to the response from within Flask.
teardown_request is only intended for cleaning up resources.
If you need to log something about the response and absolutely don't want to use
after_request, you'll have to wrap the Flask app in WSGI middleware.