Does idempotency include response codes?

后端 未结 1 1487
醉话见心
醉话见心 2021-01-30 16:52

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 ans

1条回答
  •  清酒与你
    2021-01-30 17:18

    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.

    0 讨论(0)
提交回复
热议问题