Frage

I want to access html files which are protected by basic authentication. I am trying to load this html page using htmlloader and sending the request by urlRequest. I am using URLRequestDefaults class to set the credentials but when I see the request being send in the fiddler I don't see any authorization header being set by this. Am I doing something wrong here. My code is below.

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);
War es hilfreich?

Lösung

You should read the API more carefully:

Note that "example.com", "www.example.com", and "sales.example.com" are each considered unique hosts.

In this case, the domains don't match.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top