7
def make_req(data, url, method='POST')
params = urllib.urlencode(data)
headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain",
}
conn = httplib.HTTPSConnection(url)
conn.request(method, url, params, headers)
response = conn.getresponse()
response_data = response.read()
conn.close()
但它拋出:in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): gaierror: [Errno -2] Name or service not known
gaierror:[錯誤-2]產品名稱或服務不知道
的原因是什麼?這個錯誤是什麼?