RequestContext¶
Import: import system.webapi;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
RequestContext¶
Per-request bag shared by middleware and @dep functions.
incoming¶
Request received from the client.
app_state¶
Application values shared by requests.
state¶
Values stored for this request by handlers and middleware.
cancellation_token¶
Cancellation signal for the current request, when available.
constructor¶
Creates a RequestContext with incoming.
add_cleanup¶
Registers request cleanup, run once in reverse acquisition order outside request cancellation.
set¶
Stores value under key for the rest of this request, replacing any earlier value.
get¶
Returns the value stored under key for this request, or None when nothing was stored.