title: Python: Request URL via POST and show result in browser
body: <p>I'm a developer for a big GUI app and we have a web site for bug tracking. Anybody can submit a new bug to the bug tracking site. We can detect certain failures from our desktop app (i.e. an unhandled exception) and in such cases we would like to open the submit-new-bug form in the user predefined browser, <strong>adding whatever information we can gather about the failure to some form fields</strong>. We can either retrieve the submit-new-bug form using GET or POST http methods and we can provide default field values to that form. So from the http server side everything is pretty much OK.</p>
  
  <p>So far we can successfully open a URL passing the default values as GET parameters in the URL using <a href="http://docs.python.org/library/webbrowser.html" rel="noreferrer">the <code>webbrowser</code> module</a> from the Python Standard Library. There are, however, some <a href="http://www.cs.tut.fi/~jkorpela/forms/methods.html#exc" rel="noreferrer">limitations of this method</a> such as the maximum allowed length of the URL for some browsers (<a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q208427" rel="noreferrer">specially MS IE</a>). The <code>webbrowser</code> module doesn't seem to have a way to request the URL using POST. OTOH there's <a href="http://docs.python.org/library/urllib2.html" rel="noreferrer">the <code>urllib2</code> module</a> that provides the type of control we want but AFAIK it lacks the possibility of opening the retrieved page in the user preferred browser.</p>
  
  <p><strong>Is there a way to get this mixed behavior we want (to have the fine control of <a href="http://docs.python.org/library/urllib2.html" rel="noreferrer"><code>urllib2</code></a> with the higher level functionallity of <a href="http://docs.python.org/library/webbrowser.html" rel="noreferrer"><code>webbrowser</code></a>)?</strong></p>
  
  <p>PS: We have thought about the possibility of retreiving the URL with <a href="http://docs.python.org/library/urllib2.html" rel="noreferrer"><code>urllib2</code></a>, saving its content to a temp file and opening that file with <a href="http://docs.python.org/library/webbrowser.html" rel="noreferrer"><code>webbrowser</code></a>. This is a little nasty solution and in this case we would have to deal with other issues such as relative URLs. Is there a better solution?</p>