Skip to content Skip to sidebar Skip to footer

Gaierror: [errno -2] Name Or Service Not Known

def make_req(data, url, method='POST') params = urllib.urlencode(data) headers = {'Content-type': 'application/x-www-form-urlencoded', 'Accept': 'text/pl

Solution 1:

You need to call request() with the URI relative to the server. If url is www.google.com/images?q=test you have to do:

conn = httplib.HTTPSConnection('www.google.com')
conn.request('GET', '/images?q=test')

Post a Comment for "Gaierror: [errno -2] Name Or Service Not Known"