def send_basic_auth(self, connection):
        """Include HTTP Basic Authentication data in a header"""
        
        auth = base64.encodestring("%s:%s"%self.credentials).strip()
        auth = 'Basic %s' %(auth,)
        connection.putheader('Authorization',auth)
Include HTTP Basic Authentication data in a header
recipes/Python/501148_xmlrpc_serverclient_which_does_cookie_handling/recipe-501148.py