且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

与HTTP和REST比较的Get和post方法之间的区别

更新时间:2023-12-04 11:31:34

GET应该用于检索资源。此操作应该是幂等的,这意味着它不应该更改服务器上的任何状态。

GET should be used to retrieve a resource. This operation should be idempotent, meaning it should not change any state on the server.

POST应该用于向服务器添加新信息。这通常在表示资源容器的URL上执行。 POST将向此容器添加新资源。

POST should be used to add new information to the server. This is usually performed on a URL that represents a "container" of resources. The POST will add a new resource to this container.

PUT应该用于更新现有资源。

PUT should be used to update an existing resource.

DELETE应该是显而易见的。

DELETE should be obvious.

您可能会喜欢这样阅读: http://tomayko.com/writings/rest-to-my-wife

You might enjoy reading this: http://tomayko.com/writings/rest-to-my-wife