1 Reply Latest reply on Mar 15, 2007 1:48 PM by ClownBootz

    how to add  custom header to httpservice call

    kiran.krishh
      how can i add entires to the HTTP header. i am using the HTTPService class, it does have a headers property which i am setting but the request is not getting updated...maybe i am not setting the headers as required.....can anyone help me how to set this.
        • 1. Re: how to add  custom header to httpservice call
          ClownBootz
          I have been at this since yesterday and still have not been able to get basic authentication header parameters added ... i have tried the HTTPService tag and have not been successfull ... below is a code snippet using URLLoader that i really think should work ... i will let you know if i get it ..

          var base64:Base64Encoder = new Base64Encoder();
          base64.encode("test:test");
          var credentials64:String = base64.flush();

          var urlRequest:URLRequest = new URLRequest();
          urlRequest.url = serverInfo + "/webservices/UserWebServices?wsdl";
          urlRequest.method = URLRequestMethod.POST;
          var header:URLRequestHeader = new URLRequestHeader("Authorization", "Basic " + credentials64);
          urlRequest.requestHeaders.push(header);
          var loader:URLLoader = new URLLoader();
          loader.load(urlRequest);
          loader.addEventListener(Event.COMPLETE, httpLoaded);