def _http_request(
        self,
        method,
        url: str,
        ok_code: int = 200,
        timeout: float = TIMEOUT,
        **kwargs,
    ):
        """Wrap request method for handling status codes."""
        response = requests.request(
            method=method,
            url=url,
            timeout=timeout,
            **kwargs,
        )
        if response.status_code != ok_code:
            logging.error(f"Failed to {method} {url}. Response: {response.text}")
            raise ApiResponseException(method, url=url, res=response)
        if response.status_code == requests.codes["no_content"]:
            return None
        return response.json()
Wrap request method for handling status codes.
Solutions/ZeroFox/Data Connectors/CTI/AzureFunctionZeroFoxCTI/connections/zerofox.py