tfchain/internal/HttpClient.py
def simpleAuth(self, url, username, password):
        """
        authorize with the given username and password on url
        :param url:
        :type url: str
        :param username: username to authorize with
        :type username: str
        :param password: password for username
        :type password: str
        :raises RuntimeError: IOError is caught when failing to open url from the request 
        :return: handle
        :rtype:
        """
        req = urllib.request.Request(url)
        auth = '%s:%s' % (username, password)
        base64string = base64.encodebytes(auth.encode())[:-1]
        req.add_header("Authorization", "Basic %s" % base64string)

        try:
            handle = urllib.request.urlopen(req)
            return handle
        except IOError as e:
            raise RuntimeError("could not do simple auth.\n%s" % e)

        authorize with the given username and password on url
        :param url:
        :type url: str
        :param username: username to authorize with
        :type username: str
        :param password: password for username
        :type password: str
        :raises RuntimeError: IOError is caught when failing to open url from the request 
        :return: handle
        :rtype:
        
authorize with the given username and password on url
authorize with the given username and password on url
def simpleAuth(self, url, username, password):
        req = urllib.request.Request(url)
        auth = '%s:%s' % (username, password)
        base64string = base64.encodebytes(auth.encode())[:-1]
        req.add_header("Authorization", "Basic %s" % base64string)
        try:
            handle = urllib.request.urlopen(req)
            return handle
        except IOError as e:
            raise RuntimeError("could not do simple auth.\n%s" % e)
def simpleAuth ( self , url , username , password ) : req = urllib . request . Request ( url ) auth = '%s:%s' % ( username , password ) base64string = base64 . encodebytes ( auth . encode ( ) ) [ : - 1 ] req . add_header ( "Authorization" , "Basic %s" % base64string ) try : handle = urllib . request . urlopen ( req ) return handle except IOError as e : raise RuntimeError ( "could not do simple auth.\n%s" % e )
authorize with the given username and password on url
authorize with the given username and password on url
"""
        authorize with the given username and password on url
        :param url:
        :type url: str
        :param username: username to authorize with
        :type username: str
        :param password: password for username
        :type password: str
        :raises RuntimeError: IOError is caught when failing to open url from the request 
        :return: handle
        :rtype:
        """
None
IOError is caught when failing to open url from the request
IOError is caught when failing to open url from the request
RuntimeError
self
url
None
username
username to authorize with
username to authorize with
password
password for username
password for username