def _perform_appengine_request(self, host, path, method, timeout, params=None, data=None):
        """
        Perform an HTTPS request with AppEngine's urlfetch. SSL certificate will not validate when 
        the request is on a domain which is not a aloglia.net subdomain, a SNI is not available by
        default on GAE. Hence, we do set validate_certificate to False when calling those domains.
        """
        method = APPENGINE_METHODS.get(method)
        if isinstance(timeout, tuple):
            timeout = timeout[1]
        url = 'https://%s%s' % (host, path)
        url = params and '%s?%s' %(url, urlencode(urlify(params))) or url
        res = urlfetch.fetch(url=url, method=method, payload=data,
                                headers=self.headers, deadline=timeout,
                                validate_certificate=host.endswith(SSL_CERTIFICATE_DOMAIN))
        content = res.content != None and json.loads(res.content) or None
        if (int(res.status_code / 100) == 2 and content):
            return content
        elif (int(res.status_code / 100) == 4):
            message = "HttpCode: %d" % res.status_code
            if content and content.get('message'):
                message = content['message']
            raise AlgoliaException(message)
        else:
            mesage = '%s Server Error: %s' % (res.status_code, res.content)
            raise Exception(http_error_msg, response=res)
dataset/ETHPy150Open algolia/algoliasearch-client-python/algoliasearch/client.py/Client._perform_appengine_request/original