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

Method read

httpx/_models.py:468–480  ·  httpx/_models.py::Request.read

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 class="st">"""
470 Read and return the request content.
471 class="st">"""
472 if not hasattr(self, class="st">"_content"):
473 assert isinstance(self.stream, typing.Iterable)
474 self._content = bclass="st">"".join(self.stream)
475 if not isinstance(self.stream, ByteStream):
476 class="cm"># If a streaming request has been read entirely into memory, then
477 class="cm"># we can replace the stream with a raw bytes implementation,
478 class="cm"># 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 class="st">"""

Calls 2

ByteStreamClass · 0.85
joinMethod · 0.80