getting POST vars from BaseHTTPRequestHandler
and-google at doxdesk.com
and-google at doxdesk.com
Tue Jun 27 23:51:57 EDT 2006
Christopher J. Bottaro wrote:
> When I make a post, it just hangs (in self.rfile.read()).
I don't know about BaseHTTPRequestHandler in particular, but in general
you don't want to call an unlimited read() on an HTTP request - it will
try to read the entire incoming stream, up until the stream is ended by
the client dropping the connection (by which point it's too late to
send a response).
Instead you'll normally want to read the request's Content-Length
header (int(os.environ['CONTENT_LENGTH']) under CGI) and read(that
many) bytes.
--
And Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/
More information about the Python-list
mailing list