title: How do I get Ruby on Rails to work with ASIHTTPRequest?
body: <p>I am creating an iOS application with a Ruby on Rails backend. I've got my logic setup and working in Rails, and have verified by testing in a web browser. My Rails application will not respond properly to my iOS application, saying something about an authenticity token.</p>
  
  <p>I have setup an authenticity token in application.rb with the following code (I did a server reboot after adding this):</p>
  
  <pre><code>protect_from_forgery :secret =&gt; 'some_secret_here'
  </code></pre>
  
  <p>I'm passing the authenticity token from iOS to Rails with ASIHTTPRequest using the following code:</p>
  
  <pre><code>ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
  [request setPostValue:@"some_secret_here" forKey:@"authenticity_token"];
  [request setPostValue:@"some value" forKey:@"some_parameter"];
  [request setDelegate:self];
  [request startAsynchronous];
  </code></pre>
  
  <p>Is there anything I'm missing or doing wrong?</p>
  
  <p>This same code works fine with allow_forgery_protection set to false, so I assume the error lies in how I'm trying to pass the authenticity token.</p>