view.core.body¶
Classes
|
Mixin dataclass for common HTTP body operations. |
Exceptions
|
The body was already used on this response. |
|
The body is not valid JSON data or something went wrong when parsing it. |
- class BodyMixin(receive_data: Callable[[], AsyncIterator[bytes]])¶
Bases:
objectMixin dataclass for common HTTP body operations.
- async json(*, parse_function: ~collections.abc.Callable[[str], dict[str, ~typing.Any]] = <function loads>) dict[str, Any]¶
Read the body as JSON data.
- receive_data: Callable[[], AsyncIterator[bytes]]¶
- async stream_body() AsyncIterator[bytes]¶
Incrementally stream the body, not keeping the whole thing in-memory at a given time.