Read and return the binary response content.
(self)
| 358 | return cast(R, parsed) |
| 359 | |
| 360 | def read(self) -> bytes: |
| 361 | """Read and return the binary response content.""" |
| 362 | try: |
| 363 | return self.http_response.read() |
| 364 | except httpx.StreamConsumed as exc: |
| 365 | # The default error raised by httpx isn't very |
| 366 | # helpful in our case so we re-raise it with |
| 367 | # a different error message. |
| 368 | raise StreamAlreadyConsumed() from exc |
| 369 | |
| 370 | def text(self) -> str: |
| 371 | """Read and decode the response content into a string.""" |