Skip to content

Instantly share code, notes, and snippets.

@madssj
Created June 4, 2013 08:46
Show Gist options
  • Save madssj/5704565 to your computer and use it in GitHub Desktop.
Save madssj/5704565 to your computer and use it in GitHub Desktop.
var a:XML = <request command="run-command" />;
var r:URLRequest = new URLRequest("http://localhost/service.php");
r.data = a;
r.method = URLRequestMethod.POST;
r.contentType = "text/xml";
var l:URLLoader = new URLLoader();
l.addEventListener(Event.COMPLETE, function(e:Event) {
trace("success", l.data);
});
l.addEventListener(IOErrorEvent.IO_ERROR, function(e:Event) {
trace("failed", e);
});
l.load(r);
var a:XML = <request command="run-command" />;
var r:URLRequest = new URLRequest("http://localhost/service.php");
r.data = a.toXMLString();
r.method = URLRequestMethod.POST;
r.contentType = "text/xml";
var l:URLLoader = new URLLoader();
l.addEventListener(Event.COMPLETE, function(e:Event) {
trace("success", l.data);
});
l.addEventListener(IOErrorEvent.IO_ERROR, function(e:Event) {
trace("failed", e);
});
l.load(r);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment