HTTPS POST request Python, returning .csv
I want to make a post request to a HTTPS-site that should respond with a .csv file. I have this Python code: try: #conn = httplib.HTTPSConnection(host="www.site.com", port=443) => Gives an BadStatusLine: ' ' error 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] Output: Found 302 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0/