Retrieve input

Fredrik Lundh fredrik at pythonware.com
Thu Dec 1 17:09:31 EST 2005


"amfr" wrote:

> A little while ago, someone told me that for the BaseHTTPServer module,
> the whole request would be stored in self.rfile.
> I looked at the doumentation and is says rfile is:
> "Contains an input stream, positioned at the start of the optional
> input data."
> How do i get the input out of it?

by reading from it, as you would read data from any other file:

    http://docs.python.org/lib/bltin-file-objects.html

(the word "stream" usually refers to a file or file-like object.  seeking
is usually not supported, and file-like objects may not implement all
the methods available on a "real" file object.  the basics should work,
though: read, readline, etc.)

</F>






More information about the Python-list mailing list