2 Replies Latest reply on Feb 2, 2011 12:12 PM by Chris McLaughlin

    Difficulty replicating simple HTML POST in AS3

    Chris McLaughlin Level 1

      Hi,

       

      I'm trying to post a username and password to a server side script.  The client provided an HTML form that demonstrates that the sever side functionality is working, but I keep getting the following:

       

      <response>
      Invalid UserName / Password Combination
      </response>

       

       

      Here's the HTML code:

      html> 


      Here's what I have been doing in AS3:

       

       

      var loader:URLLoader = new URLLoader();
      configureListeners(loader);
      var header:URLRequestHeader = new URLRequestHeader("pragma", "no-cache");
      var request:URLRequest = new URLRequest("http://sitename.net/login");
      request.data = new URLVariables();
      request.data.username = "username";
      request.data.password = "password";
      request.method = URLRequestMethod.POST;
      request.requestHeaders.push(header);
      
      try {
       loader.load(request);
       } catch (error:Error) {
       trace("Unable to load requested document.");
       }
      }
      

       

      Any insight would be appreciated.

       

      Best regards,

       

       

      Chris McLaughlin