restについて

rest について調べたこと。
まだ本格利用してないので、そのうちやる。

GET はリソースを取得するメソッド
PUT はリソースを更新するメソッド
DELETE はリソースを削除するメソッド
POST はリソースを新規作成するメソッド
GET はリソースに副作用を与えない

http://yohei-y.blogspot.jp/2005/04/rest-5-get-post-put-delete.html

# GET
$ curl http://localhost:3000/users.xml
$ curl http://localhost:3000/users/3.xml

# POST
$ curl http://localhost:3000/users -X POST -d "user[name]=postman" -d "user[age]=19"

# PUT
$ curl http://localhost:3000/users/4 -X PUT -d "user[name]=putman" -d "user[age]=20" 

# DELETE
$ curl http://localhost:3000/users/5 -X DELETE

http://d.hatena.ne.jp/thata/20100207/1265554365