Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5730B11696 for ; Tue, 23 Sep 2014 09:14:38 +0000 (UTC) Received: (qmail 68023 invoked by uid 500); 23 Sep 2014 09:14:38 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 67992 invoked by uid 500); 23 Sep 2014 09:14:38 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Delivered-To: moderator for users@flex.apache.org Received: (qmail 87826 invoked by uid 99); 23 Sep 2014 07:20:50 -0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of anthony.manach@hotmail.fr does not designate 162.253.133.43 as permitted sender) Date: Tue, 23 Sep 2014 00:20:04 -0700 (PDT) From: Tonic To: users@flex.apache.org Message-ID: <1411456804314-8101.post@n4.nabble.com> In-Reply-To: References: <1411025781280-8064.post@n4.nabble.com> Subject: Re: HTTP Service - Basic Authentication - Access Forbidden Error 401 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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.