Mystery in Ruby sinatra
- by JVK
I have the following Sinatra code:
post '/bucket' do
# determine if this call is coming from filling out web form
is_html = request.content_type.to_s.downcase.eql?('application/x-www-form-urlencoded')
# If this is a curl call, then get the params differently
unless is_html
params = JSON.parse(request.env["rack.input"].read)
end
…