URLRequestDefaults.setLoginCredentialsForHost没有在授权标头中设置用户和密码

| 我想访问受基本身份验证保护的html文件。 我正在尝试使用htmlloader加载此html页面,并通过urlRequest发送请求。 我正在使用URLRequestDefaults类设置凭据,但是当我在提琴手中看到请求正在发送时,我看不到此设置的任何授权标头。 我在这里做错什么了吗?我的代码如下。
URLRequestDefaults.authenticate = false;
URLRequestDefaults.setLoginCredentialsForHost(\"www.xyz.com\", \"madhur\", \"sharma\");
var req:URLRequest = new URLRequest(\"http://bazinga.xyz.com/MyHtml/index.html\");
htmlControl.htmlLoader.load(urlRequest);
    
已邀请:
        您应该更仔细地阅读API:   请注意,\“ example.com \”,\“ www.example.com \”和\“ sales.example.com \”均被视为唯一主机。 在这种情况下,域不匹配。     

要回复问题请先登录注册