Flask - access the request in after_request or teardown_request
The solution is simple -
from flask import request
@app.after_request
def after_request(response):
do_something_based_on_the_request_endpoint(request)
return response
The solution is simple -
from flask import request
@app.after_request
def after_request(response):
do_something_based_on_the_request_endpoint(request)
return response