def _validate_response(response):
        """
        Return response if ok, raise RequestException if not ok
        :param response: requests.response object
        :return: requests.response object
        """
        try:
            response.raise_for_status()
        except requests.RequestException:
            raise RequestException(
                code=response.status_code,
                url=response.url,
                description=response.text)
        else:
            return response
Return response if ok, raise RequestException if not ok
        :param response: requests.response object
        :return: requests.response object