Context
ASGI request context management.
AsgiContext - ASGI-specific routing context.
Provides access to request, response, and application resources for handlers that need transport-specific functionality.
Note: Most handlers should NOT access context directly. They should receive parameters from the dispatcher and return Python objects. Context access is for special cases like setting cookies or accessing session data.
- class genro_asgi.context.AsgiContext(request, app, server)[source]
Bases:
RoutingContextASGI-specific execution context.
Provides access to HTTP request/response and application resources. Created per-request by the dispatcher and injected into RoutingClass.
- request
Current HTTP request.
- response
Current HTTP response builder.
- app
Application instance handling the request.
- server
Server instance.
- property app: AsgiApplication
Application instance handling the request.
- property request: BaseRequest
Current HTTP request.
- property server: AsgiServer
Server instance.