This is the code that works just fine:
require 'sinatra' post '/foo' do "Equals to #{params[:a]}!" end If I send POST request, it returns all right:
$ ruby foo.rb -p 8888 $ curl -X POST -H 'Content-Length: 5' --data 'a=444' http://localhost:8888/foo Equals to 444! Then, I modify the code, adding Rack::RewindableInput::Middleware because it's necessary for another case, where rewind was available in earlier versions of Rack:
require 'sinatra' use Rack::RewindableInput::Middleware post '/foo' do "Equals to #{params[:a]}!" end I'm getting this:
$ ruby foo.rb -p 8888 $ curl -X POST -H 'Content-Length: 5' --data 'a=444' http://localhost:8888/foo Equals to ! What am I doing wrong?