Module httplib :: Class HTTPMessage
[hide private]
[frames] | no frames]

_ClassType HTTPMessage

rfc822.Message --+    
 mimetools.Message --+

Instance Methods [hide private]
addheader(self, key, value)
Add header for field key handling repeats.
addcontinue(self, key, more)
Add more field data from a continuation line.
Read header lines.

Inherited from mimetools.Message: __init__, getencoding, getmaintype, getparam, getparamnames, getplist, getsubtype, gettype, parseplist, parsetype

Inherited from rfc822.Message: __contains__, __delitem__, __getitem__, __iter__, __len__, __setitem__, __str__, get, getaddr, getaddrlist, getallmatchingheaders, getdate, getdate_tz, getfirstmatchingheader, getheader, getheaders, getrawheader, has_key, iscomment, isheader, islast, items, keys, rewindbody, setdefault, values

Method Details [hide private]



Read header lines.

Read header lines up to the entirely blank line that terminates them. The (normally blank) line that ends the headers is skipped, but not included in the returned list. If a non-header line ends the headers, (which is an error), an attempt is made to backspace over it; it is never included in the returned list.

The variable self.status is set to the empty string if all went well, otherwise it is an error message. The variable self.headers is a completely uninterpreted list of lines contained in the header (so printing them will reproduce the header exactly as it appears in the file).

If multiple header fields with the same name occur, they are combined according to the rules in RFC 2616 sec 4.2:

Appending each subsequent field-value to the first, each separated by a comma. The order in which header fields with the same field-name are received is significant to the interpretation of the combined field value.

Overrides: rfc822.Message.readheaders