現在,在我看來,GET和POST都用於從服務器獲取資源。唯一的區別是POST請求的有效載荷包含額外的數據,但GET請求沒有。今天,我讀了這一點:關於POST,GET,PUT,DELETE的困惑
GET: **fetch an existing resource**. The URL contains all the necessary information the server needs to locate and return the resource.
POST: **create a new resource**. POST requests usually carry a payload that specifies the data for the new resource.
PUT: **update an existing resource**. The payload may contain the updated data for the resource.
DELETE: **delete an existing resource**.
我不明白爲什麼POST可以創建新的資源。我從來沒有見過PUT和DELETE。
任何人都可以爲我解釋一下嗎?謝謝。
閱讀維基百科文章(認真地說,它有更好的解釋):http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods – Blender
你要求解釋它,你已經提供瞭解釋。有什麼不清楚你讀的是什麼? –
謝謝,但我的意思是我明白POST也會獲取現有資源,如GET。防爆。當我提交一個表單(這是POST,好的),一個頁面被請求,我沒有看到任何資源創建? – hienbt88