12345678auth_user = 'admin'auth_passwd = '123456'usrPass = "%s:%s" % (auth_user, auth_passwd)b64Val = base64.b64encode(usrPass.encode('utf-8'))headers = { "Authorization": "Basic %s" % b64Val.decode(),}print(headers)