httplib.HTTPMessage

class httplib.HTTPMessage(fp, seekable=1)[source]

Methods

__contains__(name) Determine whether a message contains the named header.
__delitem__(name) Delete all occurrences of a specific header, if it is present.
__getitem__(name) Get a specific header, as from a dictionary.
__init__(fp[, seekable])
__iter__()
__len__() Get the number of headers in a message.
__setitem__(name, value) Set the value of a header.
__str__()
addcontinue(key, more) Add more field data from a continuation line.
addheader(key, value) Add header for field key handling repeats.
get(name[, default]) Get the header value for a name.
getaddr(name) Get a single address from a header, as a tuple.
getaddrlist(name) Get a list of addresses from a header.
getallmatchingheaders(name) Find all header lines matching a given header name.
getdate(name) Retrieve a date field from a header.
getdate_tz(name) Retrieve a date field from a header as a 10-tuple.
getencoding()
getfirstmatchingheader(name) Get the first header line matching name.
getheader(name[, default]) Get the header value for a name.
getheaders(name) Get all values for a header.
getmaintype()
getparam(name)
getparamnames()
getplist()
getrawheader(name) A higher-level interface to getfirstmatchingheader().
getsubtype()
gettype()
has_key(name) Determine whether a message contains the named header.
iscomment(line) Determine whether a line should be skipped entirely.
isheader(line) Determine whether a given line is a legal header.
islast(line) Determine whether a line is a legal end of RFC 2822 headers.
items() Get all of a message’s headers.
keys() Get all of a message’s header field names.
parseplist()
parsetype()
readheaders() Read header lines.
rewindbody() Rewind the file to the start of the body (if seekable).
setdefault(name[, default])
values() Get all of a message’s header field values.