Fork me on GitHub

6/27/2013

HTTP POST and PUT in REST way

HTTP 的 Get/Post/Delete/Put 對應到 Resource 的 CRUD (Create, Retrieve, Update and Delete),其中 POST 和 PUT 最常讓人摸不著頭緒,不知道什麼時候該用什麼。

今天 survey 了一下網路的資料,大概可以歸納出如下兩張圖,未來在遇到相關的設計時可以參照琢磨琢磨。

http-post

http-put

References

  1. SO: PUT vs POST in REST
  2. PUT or POST: The REST of the Story

No comments:

Post a Comment