举个例子:
我有一个 RESTful Web 服务。它有一个 GET/status/:item_id
端点。
我想允许项目进展到下一个状态,但我不想允许指定状态:
{SOME-HTTP-METHOD}/status/:item_id/next
。
我应该使用什么 HTTP 方法?上面列出的方法是 RESTful 吗?
最佳答案
POST
请求似乎是 the most semantic :
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions:
- Annotation of existing resources;
- (others...)
关于rest - 在 RESTful Web 服务中,增量功能应使用什么 HTTP 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45242875/