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
| Name | Type | Description |
|---|---|---|
| func | `Callable[[Request], Awaitable[Response] | Response]` |
Returns
| Type | Description |
|---|---|
ASGIApp | An ASGI application that wraps the provided function, handling request instantiation and response execution within an asynchronous context stack. |