def check(self, ipaddr):
        if self.useHttps:
            connection = httplib.HTTPSConnection(ipaddr, self.port)
        else:
            connection = httplib.HTTPConnection(ipaddr, self.port)

        try:
            connection.request(self.method, self.url, self.body, self.headers)
            response = connection.getresponse()
            return response.status in self.validStatusCodes
        except:
            return False
dataset/ETHPy150Open marccerrato/python-dns-failover/dns_failover/core.py/HttpCheck.check/original