bbcrd/REST-API-example — comment on commit 840f48406c580490ed7894e8da2ed70dca022b38
File: app.rb line 76
By seanohalpin:

Hi,

My mistake - I replied to the email - I didn't see your comment in context.

Sinatra's `put`, `post`, `get`, `delete` and `head` methods don't fire off requests - they define what the application will do when it receives an HTTP request using that verb. The `put_or_post` method simply defines two handlers (one for `put`, one for `post`) for the case when I want my application to respond the same whether it receives a PUT request or a POST request on a given endpoint. It saves me having to write out the same method body twice.

Regards,
Sean