I believe that if you are sending the JSON
in the POST
body - you should access it from request.body
, and not from params
(see this question: How to parse JSON request body in Sinatra just once and expose it to all routes?):
post '/results' do
request.body.rewind
results = JSON.parse(request.body.read, symbolize_names: true)
end