Utilizing Other Advanced Features
298
request.receive)
response: Response =
await
original_route_handler(request)
return response
return custom_route_handler
Customizing
APIRoute
requires the creation
of a Python
closure
that will directly manage the
Request
and
Response
flow from
APIRoute
’s
original_route_handler
. On the other
hand, our
ExtractContentRoute
filter uses a custom
ExtractionRequest
that identifies
and processes each type of incoming request data separately. The following is the implementation of
ExtractionRequest
that
will replace the default
Request
object:
Chia sẻ với bạn bè của bạn: