1 Reply Latest reply on Feb 18, 2007 5:44 PM by Cameron74

    HTTP POST with XML with HTTPService


      I need to be able to send an HTTP POST request to a server I have on Tomcat. In the body of the POST Request I need to have the following:

      <setView domain="someDomain" view="macro" />

      We have tried the following using the HTTPService, but with no such luck

      <mx:HTTPService id="setViewHTTPService" url="{serverURL}" resultFormat="object" contentType="application/xml" method="POST">
      <setView domain="abc" view="xyz" />

      Is there a way for us to specify the body of the HTTP Post using HTTPService, or a different class for that matter.
        • 1. Re: HTTP POST with XML with HTTPService
          var variables:URLVariables = new URLVariables("name=Franklin");
          //or variables.name = "Franklin";
          var request:URLRequest = new URLRequest();
          request.url = " http://www.[yourdomain
          request.method = URLRequestMethod.POST;
          request.data = variables;
          var loader:URLLoader = new URLLoader();
          loader.dataFormat = URLLoaderDataFormat.VARIABLES;
          loader.addEventListener(Event.COMPLETE, completeHandler);
          catch (error:Error)
          trace("Unable to load URL");

          function completeHandler(event:Event):void

          This is in the help documentation and what I generally use.