[英]How to download web resource using Digest authentication
What set of Windows API calls will allow downloading a web resource (specifically an XML document) when the site is protected using Digest authentication without having to enter a username and password? 当使用摘要式身份验证保护站点而无需输入用户名和密码时,哪些Windows API调用集将允许下载Web资源(特别是XML文档)?
I can use MSXML's “open” function on the IXMLHTTPRequest
interface, but it requires a username and password to be supplied even though I'm logged on to the Windows domain server. 我可以在
IXMLHTTPRequest
接口上使用MSXML的“打开”功能,但是即使我已登录Windows域服务器,也需要提供用户名和密码。
Internet Explorer can accomplish this task without requiring me to enter this information. Internet Explorer可以完成此任务,而无需我输入此信息。
I'm not familiar with this particular API. 我对这个特定的API不熟悉。 But it looks like there is a function to set a request header called setRequestHeader so have you tried adding the following line directly to the request header?
但是看起来好像有一个函数可以设置一个名为setRequestHeader的请求标头,所以您是否尝试过将以下行直接添加到请求标头中?
Authorization: Basic %s\\r\\n 授权:基本%s \\ r \\ n
Note: %s is name:password in base64 encoding. 注意: %s是使用base64编码的name:password 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.