0 Replies Latest reply on Jun 12, 2007 8:10 AM by roland.schroth

    URLRequest - method POST and setting Headers does not work

    roland.schroth
      Hi everybody,
      I am having a big problem with setting the method and requestHeaders of an URLRequest object.
      It simply does not work and i have absolutely no idea, why.
      I hope you can help me :-)

      This is my code:


      var base64Encoder:Base64Encoder = new Base64Encoder();
      base64Encoder.encode("user:pass");
      var credentials:String = base64Encoder.flush();

      var url:String = " http:// some.url.com";
      var request:URLRequest = new URLRequest(url);
      request.requestHeaders.push(new URLRequestHeader("Authorization","Basic " + credentials));
      request.method = URLRequestMethod.POST;

      var loader:URLLoader = new URLLoader();
      loader.addEventListener("complete",handleComplete);
      loader.load(request);



      The Requests are always done via GET and the added Header also is not sent either.
      So what is the problem here?

      Kind regards, Roland