A file part. content streams it (once, as the body is read);
content_effect collects it.
Attributes#
| Attribute | Type | Description |
|---|---|---|
key | str | |
name | str | |
content_type | str | |
content | Stream[bytes, MultipartError] | |
tag | Literal['File'] = 'File' | |
content_effect | Effect[bytes, MultipartError] |
Functions#
__init__#
__init__(key, name, content_type, content) -> None| Parameter | Type | Description |
|---|---|---|
key | str | |
name | str | |
content_type | str | |
content | Stream[bytes, MultipartError] |
to_json#
to_json() -> dict[str, object]Returns dict[str, object]
def to_json(self) -> dict[str, object]:
return {
"_id": "@effect/platform/Multipart/Part",
"_tag": "File",
"key": self.key,
"name": self.name,
"contentType": self.content_type,
}