I know I can retrieve every parameter in Sinatra using “params”.
However, How can I retrieve only post parameters? I need to verify that a parameter was sent by POST, otherwise it should be ignored.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Accessing the request object directly gives you a simple way of accessing post data, much like the php $_POST variable:
More info on the Rack request object here: http://rack.rubyforge.org/doc/classes/Rack/Request.html#M000274