When attempting to make an AJAX request from the client to Sinatra, I'm encountering an issue where the data isn't appearing as expected. Checking the Chrome request headers tab indicates that everything is correct on the client side:
Request Payload
{ test: Data }
However, on the Sinatra's side of things:
post '/api/check/:name' do
sleep 3
puts params.inspect
end
Reviewing the console output:
127.0.0.1 - - [03/Feb/2014 10:45:53] "POST /api/check/name HTTP/1.1" 200 17 3.0019
{"splat"=>[], "captures"=>["name"], "name"=>"name"}
The post data is not showing up anywhere. What could be causing this issue?