Name
add_payload
Synopsis
m
.add_payload(payload
)
Adds the payload
to
m
’s payload. If
m
’s payload was
None
,
m
’s payload is now
payload
. If
m
’s payload was a list,
appends payload
to the list. If
m
’s payload was a single
item x
,
m
’s payload becomes the
list
[
x
,payload
]
,
but only if m
’s
Content-Type header is missing or has a main type of
multipart
. Otherwise, when
m
has a single payload and a Content-Type
whose main type is not multipart
,
m
.add_payload(
payload
)
raises a MultipartConversionError
exception.
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.