现在,在我看来,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