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

Method read

httpx/_models.py:468–480  ·  view source on GitHub ↗

Read and return the request content.

(self)

Source from the content-addressed store, hash-verified

466 return self._content
467
468 def read(self) -> bytes:
469 """
470 Read and return the request content.
471 """
472 if not hasattr(self, "_content"):
473 assert isinstance(self.stream, typing.Iterable)
474 self._content = b"".join(self.stream)
475 if not isinstance(self.stream, ByteStream):
476 # If a streaming request has been read entirely into memory, then
477 # we can replace the stream with a raw bytes implementation,
478 # to ensure that any non-replayable streams can still be used.
479 self.stream = ByteStream(self._content)
480 return self._content
481
482 async def aread(self) -> bytes:
483 """

Calls 2

ByteStreamClass · 0.85
joinMethod · 0.80