根据“REST意识形态”,在响应体中应该有一个PUT / POST / DELETE请求?
返回代码怎么办? HTTP_OK是否足够?
这些公约的原因是什么?
我发现一个很好的帖子描述POST / PUT的差异: POST vs PUT但它仍然没有回答我的问题。
According to the "REST ideology" what should be in the response body for a PUT/POST/DELETE requests?
What about return codes? Is HTTP_OK enough?
What is the reason for such conventions, if any?
I've found a good post describing POST/PUT differences: POST vs PUT But it still doesn't answer my question.
最满意答案
原谅轻松,但如果您通过HTTP进行REST,则RFC7231将准确描述GET,PUT,POST和DELETE的预期行为。
Forgive the flippancy, but if you are doing REST over HTTP then RFC7231 describes exactly what behaviour is expected from GET, PUT, POST and DELETE.
Update (Jul 3 '14): The HTTP spec intentionally does not define what is returned from POST or DELETE. The spec only defines what needs to be defined. The rest is left up to the implementer to choose.
更多推荐
PUT,POST,HTTP_OK,DELETE,电脑培训,计算机培训,IT培训"/> <meta name="descr
发布评论