Is REST DELETE really idempotent?

后端 未结 8 2327
一生所求
一生所求 2020-11-30 18:43

DELETE is supposed to be idempotent.

If I DELETE http://example.com/account/123 it\'s going to delete the account.

If I do it again would I expect a 404, sin

8条回答
  •  孤街浪徒
    2020-11-30 19:24

    I think the same thing, 404 - Account doesn't exist.

    You could argue 400 - Bad Request. But in the sense of REST the object you requested to perform an action on doesn't exist. That translates to 404.

提交回复
热议问题