title: Specifying POST in rails 3 routes and calling from Flash
body: <p>I am using rails for my backend to a Flash app. I need to send a bunch of params to rails from flash using post. I have a rails action in my users_controller called register</p>
  
  <p>my routes file looks like this</p>
  
  <pre><code>  resources :users
  
    match 'register'  =&gt; 'Users#register', :via =&gt; :post
  </code></pre>
  
  <p>the actionscript looks something like this</p>
  
  <pre><code>var vars:URLVariables = new URLVariables();
  vars.first_name = "First";
  vars.last_name = "Last";
  vars.address = "555 Mysteet Rd.";
  vars.email = "me@example.com";
  vars.city = "The Hill";
  vars.provice = "KY";
  vars.postal_code = "55555";
  
  var request : URLRequest = new URLRequest("/register");
  request.method = URLRequestMethod.POST;
  request.data = vars;
  
  var loader : URLLoader = new URLLoader();
  loader.dataFormat = URLLoaderDataFormat.TEXT;
  loader.addEventListener(Event.COMPLETE, registerHandler);
  loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
  loader.load(request);
  </code></pre>
  
  <p>The error I am getting in Flash is an IO_ERROR Streaming Event bla bla bla witch usually indicates that the URL you are calling does not exist. If I change the request.method to GET then the call works but not all the data gets sent to rails because GET can't handle the length of the data being sent. </p>