URLLoader problem
Hello, I just started learning flex and I'm working on an issue that has me stumped. I want to make a request to an application at a url address and I'm expecting an XML response back.
I was able to get the expected response back using URLRequest, but only if I use navigateToURL. When I use URLLoader I get a bad response. Here's my code.
------------
var params:URLVariables = new URLVariables("username=user@email.com");
var request:URLRequest = new URLRequest();
request.url = "http://mydomain.com:8180/functiondir/function"
request.method = URLRequestMethod.POST;
request.data = params;
var urlLoad:URLLoader = new URLLoader();
urlLoad.addEventListener(Event.COMPLETE, ResultHandler);
urlLoad.addEventListener(IOErrorEvent.IO_ERROR, FaultHandler);
urlLoad.addEventListener(HTTPStatusEvent.HTTP_STATUS, HTTPHandler);
urlLoad.addEventListener(SecurityErrorEvent.SECURITY_ERROR, SecHandler);
urlLoad.load(request);
//navigateToURL(request);
---------------
The functions I defined in the event listeners print out diagnostic information. If I uncomment the line above a browser window will open with the correct XML response in it. But when I use the urlLoad.load function I get this response in firefox:
----
HTTP Response: '0'
HTTP Done
Error during submit: 'Error #2032'
Error Done
-----
Curiously, if I run the same script in IE8 I get:
----------
HTTP Response: '400'
HTTP Done
Error during submit: 'Error #2032'
Error Done