def set_basic_auth ( self , username , password ) : from requests . auth import HTTPBasicAuth self . auth = HTTPBasicAuth ( username , password ) return self
python requests add basic auth
Set authenatication .
def set_basic_auth(self, username, password):
        """
        Set authenatication.
        """
        from requests.auth import HTTPBasicAuth
        self.auth = HTTPBasicAuth(username, password)
        return self