class documentation

class SyncByteStream:

Known subclasses: httpx._client.BoundSyncStream, httpx._content.IteratorByteStream, httpx._content.UnattachedStream, httpx._multipart.MultipartStream, httpx._transports.default.ResponseStream, httpx._transports.wsgi.WSGIByteStream, httpx.ByteStream

View In Hierarchy

Undocumented

Method __iter__ Undocumented
Method close Subclasses can override this method to release any network resources after a request/response cycle is complete.
Method read Simple cases can use .read() as a convenience method for consuming the entire stream and then closing it.
def close(self):

Subclasses can override this method to release any network resources after a request/response cycle is complete.

Streaming cases should use a try...finally block to ensure that the stream close() method is always called.

Example:

status_code, headers, stream, extensions = transport.handle_request(...) try:

...
finally:
stream.close()
def read(self):

Simple cases can use .read() as a convenience method for consuming the entire stream and then closing it.

Example:

status_code, headers, stream, extensions = transport.handle_request(...) body = stream.read()
Returns
bytesUndocumented