forked from sinatra/sinatra-book
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ HTTP request methods will get you a long ways: | |
|
||
* GET | ||
* POST | ||
* PATCH | ||
* PUT | ||
* DELETE | ||
|
||
|
@@ -43,6 +44,11 @@ put '/dog/:id' do | |
# HTTP PUT request method to update an existing dog | ||
end | ||
|
||
patch '/dog/:id' do | ||
# HTTP PATCH request method to update an existing dog | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kathgironpe
Author
Owner
|
||
# See RFC 5789 for more information | ||
end | ||
|
||
delete '/dog/:id' do | ||
# HTTP DELETE request method to remove a dog who's been sold! | ||
end | ||
|
@@ -52,10 +58,11 @@ As you can see from this contrived example, Sinatra's routing is very easy to ge | |
along with. Don't be fooled, though, Sinatra can do some pretty amazing things | ||
with Routes. | ||
|
||
Take a more in-depth look at [Sinatra's routes][routes], and see for yourself. | ||
Take a more in-depth look at [Sinatra's routes][routes], and see for yourself. | ||
|
||
[routes]: http://www.sinatrarb.com/intro#Routes | ||
[restful-web-services]: http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services | ||
[RFC 5789]: http://www.rfc-base.org/rfc-5789.html | ||
|
||
## Filters | ||
|
||
|
@@ -143,7 +150,7 @@ application: | |
get '/' do | ||
session['counter'] ||= 0 | ||
session['counter'] += 1 | ||
"You've hit this page #{session['counter']} times!" | ||
"You've hit this page #{session['counter']} times!" | ||
end | ||
``` | ||
|
||
|
I think the last word is "doc" :)