Some web browsers can’t make PUT or DELETE requests, but I need to make those to my REST service written in Ruby using Sinatra. Is it possible to make Sinatra interpret a POST request as a PUT or DELETE request?
Share
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.
Please read the document and find the description of
method_override. The mechanism is identical as Rails. If your browser doesn’t supportPUT&DELETE, just send a extra parameter named_methodwith valuePUTorDELETE.Notice that in Modular application (your class inherits
Sinatra::Base),method_overrideis disabled by default. You need to enable it manually.