Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP PATCH is idempotent or non idempotent?

I have read lots of places that HTTP Patch is non-idempotent. Can someone explain me why it is non-idempotent ? Because as per the definition - Idempotent methods may or may not change the resource state, but repeated requests should have no further side effects after the first request. How a repeated PATCH request can change the Resource state?

like image 271
SSR Avatar asked Feb 10 '23 15:02

SSR


1 Answers

There's some confusion about that. The PATCH method is not required to be idempotent, that's the point. Clients can't assume their PATCH requests will be idempotent, as they can do with PUT and GET.

If a particular implementation will be idempotent or not usually depends on the patching algorithm being used, if any. For instance, a poor implementation that's not using a diff format that validates the current values won't be idempotent.

like image 187
Pedro Werneck Avatar answered Feb 19 '23 08:02

Pedro Werneck