GitHub

API reference for Stream.

A byte stream, sent as it is pulled. Its failure fails the request with an EncodeError.

Attributes

AttributeTypeDescription
streamStream_[bytes, object]
content_typestr = 'application/octet-stream'
content_lengthint | None = None
tagLiteral['Stream'] = 'Stream'

Functions

__init__

__init__(stream, content_type='application/octet-stream', content_length=None) -> None
ParameterTypeDescription
streamStream_[bytes, object]
content_typestr = 'application/octet-stream'
content_lengthint | None = None

to_json

to_json() -> dict[str, object]

Returns dict[str, object]

def to_json(self) -> dict[str, object]:
    return {
        "_id": "effect/HttpBody",
        "_tag": "Stream",
        "content_type": self.content_type,
        "content_length": self.content_length,
    }