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

Method aread

httpx/_models.py:482–494  ·  view source on GitHub ↗

Read and return the request content.

(self)

Source from the content-addressed store, hash-verified

480 return self._content
481
482 async def aread(self) -> bytes:
483 """
484 Read and return the request content.
485 """
486 if not hasattr(self, "_content"):
487 assert isinstance(self.stream, typing.AsyncIterable)
488 self._content = b"".join([part async for part in self.stream])
489 if not isinstance(self.stream, ByteStream):
490 # If a streaming request has been read entirely into memory, then
491 # we can replace the stream with a raw bytes implementation,
492 # to ensure that any non-replayable streams can still be used.
493 self.stream = ByteStream(self._content)
494 return self._content
495
496 def __repr__(self) -> str:
497 class_name = self.__class__.__name__

Callers 8

async_auth_flowMethod · 0.45
__aiter__Method · 0.45
sendMethod · 0.45
_send_handling_authMethod · 0.45
handle_async_requestMethod · 0.45

Calls 2

ByteStreamClass · 0.85
joinMethod · 0.80