I want to have access to the request object before returning an HTTP call response. I want to access the request through "teardown_request" and "after_request":
from flask import Flask ... app = Flask(__name__, instance_relative_config=True) ... @app.before_request def before_request():
I saw that I can add the request to g and do something like this:
g.curr_request = request @app.after_request def after_request(response):
But the above seems a little strange. I am sure there is a better way to access the request.
thanks
source share