def append_payload(self, payload: Payload) -> Payload:
        """Adds a new body part to multipart writer."""
        # compression
        encoding: Optional[str] = payload.headers.get(
            CONTENT_ENCODING,
            "",
        ).lower()
        if encoding and encoding not in ("deflate", "gzip", "identity"):
            raise RuntimeError(f"unknown content encoding: {encoding}")
        if encoding == "identity":
            encoding = None

        # te encoding
        te_encoding: Optional[str] = payload.headers.get(
            CONTENT_TRANSFER_ENCODING,
            "",
        ).lower()
        if te_encoding not in ("", "base64", "quoted-printable", "binary"):
            raise RuntimeError(
                "unknown content transfer encoding: {}" "".format(te_encoding)
            )
        if te_encoding == "binary":
            te_encoding = None

        # size
        size = payload.size
        if size is not None and not (encoding or te_encoding):
            payload.headers[CONTENT_LENGTH] = str(size)

        self._parts.append((payload, encoding, te_encoding))  # type: ignore[arg-type]
        return payload
Adds a new body part to multipart writer.
lib/aiohttp/multipart.py