HttpWebRequest using Basic authentication
Posted Javi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HttpWebRequest using Basic authentication相关的知识,希望对你有一定的参考价值。
System.Net.CredentialCache credentialCache = new System.Net.CredentialCache(); credentialCache.Add( new System.Uri("http://www.yoururl.com/"), "Basic", new System.Net.NetworkCredential("username", "password") ); ... ... httpWebRequest.Credentials = credentialCache;
以上是关于HttpWebRequest using Basic authentication的主要内容,如果未能解决你的问题,请参考以下文章
HttpWebrequest 身份验证失败,因为无法重用连接
权限被拒绝:user=basi,access=WRITE,inode="/":
HttpWebRequest.GetResponse() raises exception when http status code 400 (bad request) is returned(示例