[英]401 with webclient https
以下代码不断返回401:
String URI = "https://api.opsourcecloud.net/oec/0.9/myaccount";
WebClient webClient = new WebClient();
webClient.Credentials = new NetworkCredential("username", "password");
string s = webClient.DownloadString(URI);
StreamReader reader = new StreamReader( webClient.OpenRead(URI));
在最后一行。 密码和网址正确。 知道我在做什么错吗?
您是否尝试添加代理和域?
WebClient client = new WebClient();
client.Proxy = new WebProxy("<<your proxy here>>");
client.Proxy.Credentials = new NetworkCredential("login", "password", "domain");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.