Hit a given URL and return the parsed json

def _get_data(self, url, config, send_sc=True):
        """
        Hit a given URL and return the parsed json
        """
        # Load basic authentication configuration, if available.
        if config.username and config.password:
            auth = (config.username, config.password)
        else:
            auth = None

        # Load SSL configuration, if available.
        # ssl_verify can be a bool or a string
        # (http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification)
        if isinstance(config.ssl_verify, bool) or isinstance(config.ssl_verify, str):
            verify = config.ssl_verify
        else:
            verify = None

        if config.ssl_cert:
            if config.ssl_key:
                cert = (config.ssl_cert, config.ssl_key)
            else:
                cert = config.ssl_cert
        else:
            cert = None

        resp = None
        try:
            resp = requests.get(
                url, timeout=config.timeout, headers=headers(self.agentConfig), auth=auth, verify=verify, cert=cert
            )
            resp.raise_for_status()
        except Exception as e:
            # this means we've hit a particular kind of auth error that means the config is broken
            if resp and resp.status_code == 400:
                raise AuthenticationError("The ElasticSearch credentials are incorrect")

            if send_sc:
                self.service_check(
                    self.SERVICE_CHECK_CONNECT_NAME,
                    AgentCheck.CRITICAL,
                    message="Error {} when hitting {}".format(e, url),
                    tags=config.service_check_tags,
                )
            raise

        self.log.debug("request to url {} returned: {}".format(url, resp))

        return resp.json()