title: POST json to rails server
body: <pre><code>def create
    req = ActiveSupport::JSON.decode(request.body)
    if user = User.authenticate(req["email"], req["password"])
      session[:user_id] = user.id
      render :json =&gt; "{\"r\": \"t\"}" + req
    else
      render :json =&gt; "{\"r\": \"f\"}"
    end
  end
  </code></pre>
  
  <p>'create' method is in a controller and mapped to "/login", I am setting correct content types and accept headers from my curl client. I am getting a 422 http status response all the time.</p>
  
  <p>Any suggestions? </p>