title: How do you use cURL to authenticate on a Rails application that uses Devise?
body: <p>I want to test my rails web service using cURL, yet so far I could only do it while deactivating <code>before_filter :authenticate_user!</code>. But I'd like to log in a priori and then create, destroy etc.</p>
  
  <p>I saw that with cURL you can authenticate and save the session info in a cookie, that you use for your following requests, yet I couldn't make it work with Devise: in my scenario, the user logs in using an email/password combination, so I'm trying:</p>
  
  <pre>
  curl \
    -X POST \
    -d 'email=email@example.com&password=password' \
    -c cookie \
    http://localhost:3000/users/sign_in > out
  </pre>
  
  <p>and I get: <code>ActionController::InvalidAuthenticityToken in Devise/sessionsController#create</code></p>
  
  <p>Could somebody give me an idea / an example?</p>
  
  <p>Thanks!</p>