def get(self, url, ip, timeoutConnect, timeoutRead):
headers = {
'CONTENT-TYPE': 'text/xml; charset="utf-8"',
'USER-AGENT': 'uPNP/1.0'
}
try:
timeout = urllib3.util.timeout.Timeout(connect=timeoutConnect, read=timeoutRead)
http = urllib3.PoolManager(timeout=timeout)
r = http.request("GET", url, headers=headers)
if r.status == 200:
self.found_ip = ip
print("found "+ip)
self.kill_after_found()
except Exception as e:
pass
#print("Request for '%s' failed: %s" % (url, e))
评论列表
文章目录