Is PUT/DELETE idempotent with REST automatic?

前端 未结 3 1022
时光说笑
时光说笑 2021-01-30 14:32

I am learning about REST and PUT/DELETE, I have read that both of those (along with GET) is idempotent meaning that multiple requests put the server into the same state.

3条回答
  •  感动是毒
    2021-01-30 14:52

    PUT operation are idempotent but not safe operation. On success if PUT operation is repeated it will not insert duplicate records. Repeat PUT operation in case of NetworkFailure errors after verifying conditional headers like If-unmodified-since and/or if-match. Don't repeat in case of 4XX or 5XX error codes.

提交回复
热议问题