Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion httpx/_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ def __iter__(self) -> Iterator[bytes]:
else:
# Otherwise iterate.
for part in self._stream:
yield part
# For bytes types, should use yield to send data in
# chunks. Sending a very large part at once will
# result in extremely slow transmission.
for i in range(0, len(part), self.CHUNK_SIZE):
yield part[i : i + self.CHUNK_SIZE]


class AsyncIteratorByteStream(AsyncByteStream):
Expand Down