MCPcopy Create free account
hub / github.com/pallets/quart / request_context

Method request_context

src/quart/app.py:1261–1275  ·  view source on GitHub ↗

Create and return a request context. Use the :meth:`test_request_context` whilst testing. This is best used within a context, i.e. .. code-block:: python async with app.request_context(request): ... Arguments: request: A req

(self, request: Request)

Source from the content-addressed store, hash-verified

1259 return AppContext(self)
1260
1261 def request_context(self, request: Request) -> RequestContext:
1262 """Create and return a request context.
1263
1264 Use the :meth:`test_request_context` whilst testing. This is
1265 best used within a context, i.e.
1266
1267 .. code-block:: python
1268
1269 async with app.request_context(request):
1270 ...
1271
1272 Arguments:
1273 request: A request to build a context around.
1274 """
1275 return RequestContext(self, request)
1276
1277 def websocket_context(self, websocket: Websocket) -> WebsocketContext:
1278 """Create and return a websocket context.

Callers 2

test_request_contextMethod · 0.95
handle_requestMethod · 0.95

Calls 1

RequestContextClass · 0.85

Tested by 1

test_request_contextMethod · 0.76