Hi Chris, thanks for your response :)
I don't understand, I copy / past the script code, but its seems to be no
appears in the post.
This is the code in the Application :
[code]
protected function
application1_creationCompleteHandler(event:FlexEvent):void
{
search('brest');
}
private function search(value : String):void
{
var url : String = "http://ip/services/"
var urlLoader : URLLoader = new URLLoader();
var request : URLRequest = new URLRequest(url);
request.contentType = "application/json";
request.data = new
URLVariables("var1=toto&var2=tata");
request.method = URLRequestMethod.POST;
var encoder:Base64Encoder = new
Base64Encoder();
encoder.encode("user:pwd");
var credsHeader:URLRequestHeader = new
URLRequestHeader("Authorization",
"Basic " + encoder.toString());
request.requestHeaders.push(credsHeader);
urlLoader.addEventListener(Event.COMPLETE,
completeHandler);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
urlLoader.load(request);
}
private function log(value : String):void
{
trace(value);
}
protected function completeHandler(event:Event):void
{
log('completeHandler : '+event)
}
protected function
securityErrorHandler(event:SecurityErrorEvent):void
{
log('securityErrorHandler : '+event)
}
protected function
ioErrorHandler(event:IOErrorEvent):void
{
log('ioErrorHandler : '+event)
}
[/code]
Thanks for your help.
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/HTTP-Service-Basic-Authentication-Access-Forbidden-Error-401-tp8064p8101.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.