Class MessageBodyStream
A naive stream class, providing a non-blocking stream for transactions when
reading the message body. According to the HTTP standard, the following
things decide how long the message is:
* Use of the Content-Length header field (see 4.4 Message Length).
* Use of the Transfer-Coding header field (see 3.6 Transfer Codings),
particularly when the "chunked" coding is used.
NOTE: For now, we don't support the Transfer-Coding business.
Method Summary |
|
__init__ (self,
stream,
headers)
Initialise the object with the given underlying 'stream'. |
|
close (self)
Closes the stream. |
|
read (self,
limit)
Reads all remaining data from the message body. |
|
readline (self)
Reads a single line of data from the message body. |
|
readlines (self)
Reads all remaining data from the message body, splitting it into lines
and returning the data as a list of lines. |
__init__(self,
stream,
headers)
(Constructor)
Initialise the object with the given underlying 'stream'. The supplied
'headers' in a dictionary-style object are used to examine the nature of
the request.
-
|
close(self)
Closes the stream.
-
|
read(self,
limit=None)
Reads all remaining data from the message body.
-
|
readline(self)
Reads a single line of data from the message body.
-
|
readlines(self)
Reads all remaining data from the message body, splitting it into lines
and returning the data as a list of lines.
-
|