Why do we need anything more than HTTP GET, PUT, POST?

后端 未结 14 763
-上瘾入骨i
-上瘾入骨i 2021-02-04 10:09

What is the practical benefit of using HTTP GET, PUT, DELETE, POST, HEAD? Why not focus on their behavioral benefits (safety and idempotency), forgetting their names, and use GE

14条回答
  •  失恋的感觉
    2021-02-04 10:31

    Web applications using GET and POST allow users to create, view, modify and delete their data, but do so at a layer above the HTTP commands originally created for these purposes. One of the ideas behind REST is a return to the original intent of the design of the Web, whereby there are specific HTTP operations for each CRUD verb.

    Also, the HEAD command can be used to improve the user experience for (potentially large) file downloads. You call HEAD to find out how large the response is going to be and then call GET to actually retrieve the content.

提交回复
热议问题