Multipart reference¶
-
class
aiohttp.
MultipartResponseWrapper
(resp, stream)¶ Wrapper around the
MultipartReader
to take care about underlying connection and close it when it needs in.
-
class
aiohttp.
BodyPartReader
(boundary, headers, content)[source]¶ Multipart reader for single body part.
-
decode
(data)[source]¶ Decodes data according the specified
Content-Encoding
orContent-Transfer-Encoding
headers value.Supports
gzip
,deflate
andidentity
encodings forContent-Encoding
header.Supports
base64
,quoted-printable
,binary
encodings forContent-Transfer-Encoding
header.Parameters: data (bytearray) – Data to decode. Raises: RuntimeError
- if encoding is unknown.Return type: bytes
-
-
class
aiohttp.
MultipartReader
(headers, content)[source]¶ Multipart body reader.
-
classmethod
from_response
(cls, response)[source]¶ Constructs reader instance from HTTP response.
Parameters: response – ClientResponse
instance
-
classmethod