Name
get_payload
Synopsis
m.get_payload(i=None,decode=False)Returns m’s payload. When
m
.is_multipart( ) is
False, i must be
None, and
m
.get_payload( )
returns m’s entire
payload, a string or a Message instance. If
decode is true, and the value of header
Content-Transfer-Encoding is either
'quoted-printable' or 'base64',
m
.get_payload also
decodes the payload. If decode is false,
or header Content-Transfer-Encoding is missing or has other values,
m
.get_payload returns
the payload unchanged.
When m
.is_multipart( )
is True, decode must be
false. When i is
None,
m
.get_payload( )
returns m’s payload as a
list. Otherwise, m
.get_payload( ) returns the ith item of the
payload, and raises TypeError if
i is less than 0 or is
too large.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access