title: HTTPS POST request Python, returning .csv
body: <p>I want to make a post request to a HTTPS-site that should respond with a .csv file. I have this Python code:</p>
  
  <pre><code>try:
      #conn = httplib.HTTPSConnection(host="www.site.com", port=443)
  </code></pre>
  
  <p>=> Gives an BadStatusLine: ' ' error</p>
  
  <pre><code>    conn = httplib.HTTPConnection("www.site.com");
      params  = urllib.urlencode({'val1':'123','val2':'abc','val3':'1b3'})
      conn.request("POST", "/nps/servlet/exportdatadownload", params)
      content = conn.getresponse()
      print content.reason, content.status
      print content.read()
      conn.close()
  except:
      import sys
      print sys.exc_info()[:2]
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Found 302
  
  &lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;HTML&gt;&lt;HEAD&gt;
  &lt;TITLE&gt;302 Found&lt;/TITLE&gt;
  &lt;/HEAD&gt;&lt;BODY&gt;
  &lt;H1&gt;Found&lt;/H1&gt;
  The document has moved &lt;A HREF="https://www.site.com/nps/servlet/exportdatadownload"&gt;here&lt;/A&gt;.&lt;P&gt;
  &lt;HR&gt;
  &lt;ADDRESS&gt;Oracle-Application-Server-10g/10.1.3.5.0 Oracle-HTTP-Server Server at mp-www1.mrco.be Port 7778&lt;/ADDRESS&gt;
  &lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>
  
  <p>What am I doing wrong? How do I 'catch' the returning .csv file?
  I tried the POST request with an Chrome Extentions (Advanced Rest Client, and that's working...)</p>