-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example of PostBodyContentTypeParser use for JSON validation #89
Comments
# Gemfile
gem 'rack-contrib', require: false
gem 'sinatra-contrib', require: false # app.rb
require 'rack/contrib'
require 'sinatra/base'
class Api < Sinatra::Base
use Rack::PostBodyContentTypeParser
post "/" do
puts "Params automatically converted to a hash if request Content-Type is application/json:"
puts params
end
end |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you please provide an example of the following?
Been looking all over for an example of this, and I can't find anything.
Thanks in advance!
The text was updated successfully, but these errors were encountered: