title: Can't send POST request from python CGI. Why?
body: <p>Here is what I think is supposed to be sent:</p>
  
  <pre><code>POST /cgi-bin/testscript.py HTTP 1.1
  Host: www.someplace.com
  Content-Length: 50
  Cache-Control: no-cache
  Content-Type: application/x-www-form-urlencoded
  
  bleeple=yes&amp;rjunk=0%21603567240941&amp;dummy=certainly
  </code></pre>
  
  <p>But if I put that out on STDIO, apache complains about an invalid header when I send the POST line. And sure enough, it's not a header, it's the preceding request. So, ok, not a header.</p>
  
  <p>Apparently, apache is constructing that request and sending it FOR me, because if I send a GET, like this...</p>
  
  <pre><code>Location: http://www.someplace.com/cgi-bin/testscript.py?foo=bar
  </code></pre>
  
  <p>...then apache (must!?) emit this first...</p>
  
  <pre><code>GET /cgi-bin/testscript.py HTTP 1.1
  </code></pre>
  
  <p>...right? So how do I make it construct the following prefix to my headers, instead?</p>
  
  <pre><code>POST /cgi-bin/testscript.py HTTP 1.1
  </code></pre>
  
  <p>If I <em>don't</em> send the post line, then it doesn't know where the script is, and nothing happens that I can see.</p>
  
  <p>If I remove the POST line and add a Location: header with the full URL, then the surfer's browser goes there, all right, but no POST data is picked up.</p>
  
  <p>I have googled until I am half-blind and can't seem to find an answer as to how to emit a proper POST from a CGI in response to someone invoking that CGI from a form.</p>
  
  <p>Of course, this (GET) works just fine, except it exposes the params in the URL bar of the browser, which I am trying to avoid:</p>
  
  <pre><code>Location: http://www.someplace.com/cgi-bin/testscript.py?bleeple=yes&amp;rjunk=0%21603567240941&amp;dummy=certainly
  </code></pre>
  
  <p>I want to do this at the most basic level, depending on nothing but my apache server. I can do it with GET and STDIO. I can send HTTP pages, images, etc. But POST? No.</p>
  
  <p>I must be missing something fundamental -- apparently my google-fu is most weak. Or something. Help?</p>