0

idempotent means performing an operation N times yields the same results

http://restcookbook.com/HTTP%20Methods/idempotency/

the author mentions "this only applies to the result, not the resource itself". What is the difference between the result and the resource?

For example, let's say a PUT with body "hello" updates a message resource to "hello". Then PUT with "goodbye" updates it to "goodbye". Here we have 2 PUTs, and the result is NOT the same, one time the resource value is "hello" and the second time it is "goodbye".

I read Defining Idempotence whose accepted response seems to say it must be PUT with the same value(e.g. PUT "hello" twice in a row that is idempotent, not the PUT method in general).

Community
  • 1
  • 1
HukeLau_DABA
  • 2,384
  • 6
  • 33
  • 51
  • I understand that this question is older, but a good answer may be found here: https://stackoverflow.com/questions/45016234/what-is-idempotency-in-http-methods. – Avius Dec 30 '20 at 20:45

1 Answers1

0

what it is saying is that if you pass the same inputs to an idempotent method the output will always be the same

so if you put "hello" twice and the output was different because of some state the was stored in the resource then this wouldn't be idempotent.

pwilmot
  • 315
  • 1
  • 7