title: How to push GET POST requests using python through proxy?
body: <p>I am not able to pass through the proxy server to make HTTP GET requests , i have tried two ways as shown below but it returns a proxy auth fail message from our proxy server.</p>
  
  <pre><code>import requests
  
  proxies = {
  'http': 'http://ed6a1505:34103@200.200.200.5:6588/'
  }
  
  r=requests.get('http://www.google.com', proxies=proxies)
  
  print r.status_code, r.content, r.text
  </code></pre>
  
  <p>Above code sends a web page from our proxy server stating that i need to authenticate, though i have added correct ID and password in code.</p>
  
  <p>And the second method as below gives following error[error shown below the following code]:</p>
  
  <pre><code>import httplib
  import urllib
  
  proxyhost='http://ed14-19:31036@200.200.200.5'
  proxyport='6588'
  httpconn = httplib.HTTPConnection(proxyhost, proxyport)
  
  #httpconn = httplib.HTTPConnection('http://www.google.com:80')
  
  httpconn.set_tunnel('www.google.com', 80)
  httpconn.request('POST', 'http://www.google.com')
  resp = httpconn.getresponse()
  
  print resp.status, resp.reason
  resp_data = resp.read()
  print resp_data
  
  httpconn.close()
  </code></pre>
  
  <p>This gives following :</p>
  
  <pre><code>astitva@astitva-Vostro-3446:~$ python httplib1.py 
  Traceback (most recent call last):
   File "httplib1.py", line 11, in &lt;module&gt;
    httpconn.request('POST', 'http://www.google.com')
   File "/usr/lib/python2.7/httplib.py", line 979, in request
    self._send_request(method, url, body, headers)
   File "/usr/lib/python2.7/httplib.py", line 1013, in _send_request
    self.endheaders(body)
   File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
    self._send_output(message_body)
   File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
    self.send(msg)
   File "/usr/lib/python2.7/httplib.py", line 797, in send
    self.connect()
   File "/usr/lib/python2.7/httplib.py", line 778, in connect
    self.timeout, self.source_address)
   File "/usr/lib/python2.7/socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  socket.gaierror: [Errno -2] Name or service not known
  </code></pre>