Skip to main content

request_response

Takes a function or coroutine func(request) - > response, and returns an ASGI application.

def request_response(
func: Callable[[Request], Awaitable[Response] | Response]
) - > ASGIApp

Takes a function or coroutine func(request) - > response, and returns an ASGI application.

Parameters

NameTypeDescription
func`Callable[[Request], Awaitable[Response]Response]`

Returns

TypeDescription
ASGIAppAn ASGI application that wraps the provided function, handling request instantiation and response execution within an asynchronous context stack.