C# Basic 认证,HttpClient

内容纲要

            // 设置 client
            HttpClient client = new HttpClient();
            client.DefaultRequestHeaders.Authorization =
              new System.Net.Http.Headers.AuthenticationHeaderValue
               ("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{user}:{password}")));
点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注