相关疑难解决方法(0)

我应该使用什么编码进行HTTP基本身份验证?

RFC2617表示将用户名和密码编码为base64,但没有说明在创建用于输入base64算法的八位字节时要使用的字符编码.

我应该假设US-ASCII或UTF8吗?或者有人已经在某处解决了这个问题?

http basic-authentication

73
推荐指数
3
解决办法
4万
查看次数

HTTP请求标头中缺少基本HTTP身份验证条目

我有以下代码:

WebClient client = new WebClient();
String un = "Username";
String pw = "Password";
client.Credentials =  new System.Net.NetworkCredential(un,pw);
client.DownloadFileCompleted +=
            new AsyncCompletedEventHandler(downloadFileCompleted);
client.DownloadFileAsync(new Uri(url), Config.LocalDir + @"\data\supportData.xml");
Run Code Online (Sandbox Code Playgroud)

在服务器上使用NetworkMonitor我收到以下内容:

Http: Request, GET /audiClave/REST/en/actions 
Command: GET
URI: /audiClave/REST/en/actions
ProtocolVersion: HTTP/1.1
Host:  210.xxx.xxx.xxx:8080
Connection:  Keep-Alive
HeaderEnd: CRLF
Run Code Online (Sandbox Code Playgroud)

没有验证条目.我错过了什么?

c# webclient

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

basic-authentication ×1

c# ×1

http ×1

webclient ×1