quart.asgi module#
- class quart.asgi.ASGIHTTPConnection(app: Quart, scope: HTTPScope)#
Bases:
object
- async handle_messages(request: Request, receive: Callable[[], Awaitable[HTTPRequestEvent | HTTPDisconnectEvent | WebsocketConnectEvent | WebsocketReceiveEvent | WebsocketDisconnectEvent | LifespanStartupEvent | LifespanShutdownEvent]]) None #
- async handle_request(request: Request, send: Callable[[HTTPResponseStartEvent | HTTPResponseBodyEvent | HTTPServerPushEvent | HTTPEarlyHintEvent | HTTPDisconnectEvent | WebsocketAcceptEvent | WebsocketSendEvent | WebsocketResponseStartEvent | WebsocketResponseBodyEvent | WebsocketCloseEvent | LifespanStartupCompleteEvent | LifespanStartupFailedEvent | LifespanShutdownCompleteEvent | LifespanShutdownFailedEvent], Awaitable[None]]) None #
- class quart.asgi.ASGIWebsocketConnection(app: Quart, scope: WebsocketScope)#
Bases:
object
- async accept_connection(send: Callable[[HTTPResponseStartEvent | HTTPResponseBodyEvent | HTTPServerPushEvent | HTTPEarlyHintEvent | HTTPDisconnectEvent | WebsocketAcceptEvent | WebsocketSendEvent | WebsocketResponseStartEvent | WebsocketResponseBodyEvent | WebsocketCloseEvent | LifespanStartupCompleteEvent | LifespanStartupFailedEvent | LifespanShutdownCompleteEvent | LifespanShutdownFailedEvent], Awaitable[None]], headers: Headers, subprotocol: str | None) None #
- async close_connection(send: Callable[[HTTPResponseStartEvent | HTTPResponseBodyEvent | HTTPServerPushEvent | HTTPEarlyHintEvent | HTTPDisconnectEvent | WebsocketAcceptEvent | WebsocketSendEvent | WebsocketResponseStartEvent | WebsocketResponseBodyEvent | WebsocketCloseEvent | LifespanStartupCompleteEvent | LifespanStartupFailedEvent | LifespanShutdownCompleteEvent | LifespanShutdownFailedEvent], Awaitable[None]], code: int, reason: str) None #
- async handle_messages(receive: Callable[[], Awaitable[HTTPRequestEvent | HTTPDisconnectEvent | WebsocketConnectEvent | WebsocketReceiveEvent | WebsocketDisconnectEvent | LifespanStartupEvent | LifespanShutdownEvent]]) None #
- async handle_websocket(websocket: Websocket, send: Callable[[HTTPResponseStartEvent | HTTPResponseBodyEvent | HTTPServerPushEvent | HTTPEarlyHintEvent | HTTPDisconnectEvent | WebsocketAcceptEvent | WebsocketSendEvent | WebsocketResponseStartEvent | WebsocketResponseBodyEvent | WebsocketCloseEvent | LifespanStartupCompleteEvent | LifespanStartupFailedEvent | LifespanShutdownCompleteEvent | LifespanShutdownFailedEvent], Awaitable[None]]) None #
- async send_data(send: Callable[[HTTPResponseStartEvent | HTTPResponseBodyEvent | HTTPServerPushEvent | HTTPEarlyHintEvent | HTTPDisconnectEvent | WebsocketAcceptEvent | WebsocketSendEvent | WebsocketResponseStartEvent | WebsocketResponseBodyEvent | WebsocketCloseEvent | LifespanStartupCompleteEvent | LifespanStartupFailedEvent | LifespanShutdownCompleteEvent | LifespanShutdownFailedEvent], Awaitable[None]], data: AnyStr) None #