I am trying to make a URLRequest that uses basic HTTP authentication. The
credentials are default and unknown to the user.

I first tried using what the documentation referred to as the
URLRequestDefaults class:

http://livedocs.adobe.com/flex/3/html/help.html?content=url_requests_2.html

But this class doesn't seem to exist....

So then I tried setting the header manually:

var request:URLRequest = new URLRequest( GlobalSettings.HARVEST_GATEWAY );
var authHeader:URLRequestHeader = new URLRequestHeader("Authorization",
"Basic " + base64Encode(HARVEST_LOGIN + ":" + HARVEST_PASS));
request.requestHeaders.push(authHeader);

But then I get a runtime error:

ArgumentError: Error #2096: The HTTP request header Authorization cannot be
set via ActionScript.


So... how do I set the authorization headers for a URLRequest?

Thanks for any help!
~Aaron

Reply via email to