Skip navigation
Currently Being Moderated

Difficulty replicating simple HTML POST in AS3

Feb 2, 2011 9:04 AM

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

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points