get_route_handler() — fastapi Function Reference
Architecture documentation for the get_route_handler() function in tutorial003_py310.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 76b9112c_e10c_9fec_0fa2_a748d4271bb6["get_route_handler()"] 2152a884_3ef1_bb8b_7208_01baaa0fdc45["TimedRoute"] 76b9112c_e10c_9fec_0fa2_a748d4271bb6 -->|defined in| 2152a884_3ef1_bb8b_7208_01baaa0fdc45 2b3c8ec5_f007_7808_7e6a_0e94569b6a17["get_route_handler()"] 76b9112c_e10c_9fec_0fa2_a748d4271bb6 -->|calls| 2b3c8ec5_f007_7808_7e6a_0e94569b6a17 style 76b9112c_e10c_9fec_0fa2_a748d4271bb6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
docs_src/custom_request_and_route/tutorial003_py310.py lines 9–22
def get_route_handler(self) -> Callable:
original_route_handler = super().get_route_handler()
async def custom_route_handler(request: Request) -> Response:
before = time.time()
response: Response = await original_route_handler(request)
duration = time.time() - before
response.headers["X-Response-Time"] = str(duration)
print(f"route duration: {duration}")
print(f"route response: {response}")
print(f"route response headers: {response.headers}")
return response
return custom_route_handler
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does get_route_handler() do?
get_route_handler() is a function in the fastapi codebase, defined in docs_src/custom_request_and_route/tutorial003_py310.py.
Where is get_route_handler() defined?
get_route_handler() is defined in docs_src/custom_request_and_route/tutorial003_py310.py at line 9.
What does get_route_handler() call?
get_route_handler() calls 1 function(s): get_route_handler.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free