title: Cannot get POST values with cgi.FieldStorage
body: <p>I`m trying to send simple html page with form data to user with GET, and then receive variables from form with POST.
  HTML file looks like:</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;title&gt; My Title&lt;/title&gt;
  &lt;body&gt;
  &lt;form  method="post" action="http.py"&gt;
  &lt;input name="Name" type="text"/&gt;
  &lt;input name="Submit" type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>Here is python script:</p>
  
  <pre><code>import os
  import cgi
  import sys
  from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
  
  
  
  class customHTTPServer(BaseHTTPRequestHandler):
          def do_GET(self):
                  self.send_response(200)
                  self.send_header('Content-type', 'text/html')
                  self.end_headers()
                  fh=open('index.html','r')
                  self.wfile.write(fh.read())
                  return
  
          def do_POST(self):
              form = cgi.FieldStorage()
              self.send_response(200)
              self.end_headers()
              self.wfile.write(form['Name'].value)
  
  
  def main():
         try:
              server = HTTPServer(('',9111),customHTTPServer)
              print 'server started at port 8080'
              server.serve_forever()
         except KeyboardInterrupt:
              server.socket.close()
  
  if __name__=='__main__':
         sys.exit(main())
  </code></pre>
  
  <p>But  FieldStorage remains empty all the time. I already tried to check what is in self.rfile, and found that if i try to do self.rfile.readlines() , browser stuck and  looks like script is waiting for the end of  data stream. From where i should take Name variable that i`m submitting with  POST?</p>