title: Receiving POST data in Rails 4 and reading request.body
body: <p>I want to send a POST request to a rails application and have it save and parse the request body in the database...</p>
  
  <p>My route on the receiving end is currently setup as:</p>
  
  <pre><code>post '/request' =&gt; 'controller#receives_data'
  </code></pre>
  
  <p>when I post data to this controller I use:</p>
  
  <pre><code>def post_it
    connection.post(uri.path, "this is data", header_with_authkey)
  end
  </code></pre>
  
  <p>My controller method that receives the post is setup as:</p>
  
  <pre><code>def receives_data
     log(request.body.read)
  end
  </code></pre>
  
  <p>However I am getting a <code>422 error, unprocessable entity</code>, and the log file is always empty...</p>
  
  <p>Are there specific headers I need to include to post this to a rails app? Are there specific configurations I need to include in my controller or routes? </p>