MCPcopy
hub / github.com/encode/httpx / handle_async_request

Method handle_async_request

httpx/_transports/mock.py:29–43  ·  view source on GitHub ↗
(
        self,
        request: Request,
    )

Source from the content-addressed store, hash-verified

27 return response
28
29 async def handle_async_request(
30 self,
31 request: Request,
32 ) -> Response:
33 await request.aread()
34 response = self.handler(request)
35
36 # Allow handler to *optionally* be an `async` function.
37 # If it is, then the `response` variable need to be awaited to actually
38 # return the result.
39
40 if not isinstance(response, Response):
41 response = await response
42
43 return response

Callers 1

_send_single_requestMethod · 0.45

Calls 1

areadMethod · 0.45

Tested by

no test coverage detected