You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you please provide an example of the following?
Use sinatra-param in combination with Rack::PostBodyContentTypeParser and Rack::NestedParams to automatically parameterize JSON POST bodies and nested parameters.
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:
# app.rbrequire'rack/contrib'require'sinatra/base'classApi < Sinatra::BaseuseRack::PostBodyContentTypeParserpost"/"doputs"Params automatically converted to a hash if request Content-Type is application/json:"putsparamsendend
# app.rbrequire'rack/contrib'require'sinatra/base'classApi < Sinatra::BaseuseRack::PostBodyContentTypeParserpost"/"doputs"Params automatically converted to a hash if request Content-Type is application/json:"putsparamsendend
gem 'sinatra-contrib', require: false is not needed.
Apart from that, you can also only load the specific component you need like this: require 'rack/contrib/post_body_content_type_parser'
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: