title: Problems Posting to Sinatra with jQuery
body: <p>I'm trying to make a <code>POST</code> request to my Sinatra app, but I'm having problems.  Essentially I have an input field that on submit does something like this in the JS:</p>
  
  <pre><code>$.post("/", { info: "some_info"});
  </code></pre>
  
  <p>that is being received by sinatra like this:</p>
  
  <pre><code>post '/' do
    data = JSON.parse(request.body.read)
  end
  </code></pre>
  
  <p>However, in terminal it is saying:</p>
  
  <pre><code>JSON::ParserError - 706: unexpected token at '"info=some_info"':
  </code></pre>
  
  <p>This means that it is clearly getting the info on the server side, but I'm not sure why it is throwing this error.  I've never used AJAX before.  I'm not sure either once I get the information how I'm to get the things that I need out of it.</p>