Does idempotency include response codes?

两盒软妹~` 提交于 2019-12-20 08:46:28

问题


Do repeated requests to idempotent methods have to return the same response code?

A lot of other people are asking the same question and ending up with contradicting answers. The answer should reference an authoritative source on the matter.


回答1:


I asked this question on the HTTP mailing list and was told that idempotency does not include return codes. Meaning, you are free to return HTTP 204 the first time a resource is deleted, and HTTP 404 at a later time, so long as the subsequent request does not change the server state.

While it is true that subsequent requests may not change the server state, the response codes are not considered part of that state.



来源:https://stackoverflow.com/questions/24713945/does-idempotency-include-response-codes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!