title: Syntax for calling HTTP Servlet from Flex
body: <p>Just trying to figure out the proper syntax for making a POST to an HTTP Servlet from Flex. A Java developer gave me this URL to call:</p>
  
  <pre><code>http://myUrl:myPort/myProject/test/getFile/?fileId=1225
  </code></pre>
  
  <p>I want to build the the HTTPService url dynamically, meaning I pass the '1225' at the end. </p>
  
  <p>My question is regarding how to translate that to MXML. Does that mean my HTTPService object looks like this?</p>
  
  <pre><code>&lt;mx:HTTPService
      id="rawFileServlet"
      url="http://myUrl:myPort/myProject/test/getFile/?fileId="
      method="POST"
      showBusyCursor="true"&gt;
  
      &lt;mx:request xmlns=""&gt;
          &lt;fileId&gt;
  
          &lt;/fileId&gt;
      &lt;/mx:request&gt;
  
  &lt;/mx:HTTPService&gt;
  </code></pre>
  
  <p>And my call is this:</p>
  
  <pre><code>params["fileId"] = 1225; httpServ.send(params);
  </code></pre>
  
  <p>Is that right? Something seems strange about it. </p>
  
  <p>Here's updated code that works but doesn't allow me to trap remote errors nicely:</p>
  
  <pre><code>var url:String = model.fileUploadServletUrl;
  
          var request:URLRequest = new URLRequest();
          request.method = 'POST';
          request.url = url;
  
          var uvar:URLVariables = new URLVariables();
          uvar.fileId = evt.fileId;
  
          request.data = uvar;
  
          try{
              navigateToURL( request );
          }
          catch( e:Error ){
              ErrorManager.processRemoteError( 'Download Excel failed' );
          }
  </code></pre>