(self)
Retrieve API data from Pi-hole, and return as dict on success.
Retrieve API data from Pi-hole, and return as dict on success.
Retrieve API data from Pi - hole and return as dict on success .
def get_data(self):
        """Retrieve API data from Pi-hole, and return as dict on success."""
        response = requests.get(self.url, timeout=self.timeout, verify=self.verify_ssl,)
        if response.status_code == 200:
            self.logger.debug("Got %d bytes", len(response.content))
            return self.sanitize_payload(response.json())
        else:
            self.logger.error(
                "Got unexpected response %d, %s", response.status_code, response.content
            )
def get_data ( self ) : response = requests . get ( self . url , timeout = self . timeout , verify = self . verify_ssl , ) if response . status_code == 200 : self . logger . debug ( "Got %d bytes" , len ( response . content ) ) return self . sanitize_payload ( response . json ( ) ) else : self . logger . error ( "Got unexpected response %d, %s" , response . status_code , response . content )