RFC2617表示将用户名和密码编码为base64,但没有说明在创建用于输入base64算法的八位字节时要使用的字符编码.
我应该假设US-ASCII或UTF8吗?或者有人已经在某处解决了这个问题?
我有以下代码:
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)
没有验证条目.我错过了什么?