getting POST vars from BaseHTTPRequestHandler

Christopher J. Bottaro cjbottaro at alumni.cs.utexas.edu
Mon Jun 26 17:32:53 EDT 2006


Hi,

I can't for the life of me figure out how to get the post vars when using
basehttpserver.  Here's my code:

<code>

class MyHandler(BaseHTTPRequestHandler):

   def do_POST(self):
      print self.path, self.command
      if self.rfile:
         print self.rfile.read()
      else:
         print 'no data'

server = HTTPServer(('', 80), MyHandler)
server.serve_forever()

</code>

When I make a post, it just hangs (in self.rfile.read()).

Thanks for the help.




More information about the Python-list mailing list