PUT API N times, very first request will update the resource; then rest N-1 requests will just overwrite the same resource state again and again – effectively not changing anything. Hence, PUT is idempotent.--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at https://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
If you mean you're sending a new value, that's a new PUT, and it's idempotent.If you mean you're sending a remote call to a backend procedure that updates the balance, that's not idempotent, but it's not really a REST API anymore. ...RM
On Wed, Jul 25, 2018 at 10:46 PM miqui <migm...@gmail.com> wrote:
hi folks,--If you invoke aPUTAPI N times, very first request will update the resource; then rest N-1 requests will just overwrite the same resource state again and again – effectively not changing anything. Hence, PUT is idempotent.Ok, what if the resource is a back account? ..and the PUT is updating its balance? (i am obviously changing the account)rgds,Miguel
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
> If you mean you're sending a new value, that's a new PUT, and it's idempotent.Yep. It is although hardly a good idea to "set" a bank account's value to anything.> If you mean you're sending a remote call to a backend procedure that updates the balance, that's not idempotent, but it's not really a REST API anymore.Well, REST != CRUD ... you can certainly have ressources on the web that allows the client to POST a request for an action to happen - for instance requesting that a certain value is added to a bank account.You could in principle use PUT - but in that case I would suggest PUT'ing a new *entry* to the account (not the final value of the account), using a GUID in the URL as the unique ID of the entry, allowing the server to recognize multiple attempts to PUT the same entry. In this domain I would expect to be able to GET the same entry again on the same URL, but neither be able to DELETE it nor POST or PATCH changes to it./Jørn
On Thu, Jul 26, 2018 at 8:51 PM, Richard Mateosian <xrm...@gmail.com> wrote:
If you mean you're sending a new value, that's a new PUT, and it's idempotent.If you mean you're sending a remote call to a backend procedure that updates the balance, that's not idempotent, but it's not really a REST API anymore. ...RM
On Wed, Jul 25, 2018 at 10:46 PM miqui <migm...@gmail.com> wrote:
hi folks,--If you invoke aPUTAPI N times, very first request will update the resource; then rest N-1 requests will just overwrite the same resource state again and again – effectively not changing anything. Hence, PUT is idempotent.Ok, what if the resource is a back account? ..and the PUT is updating its balance? (i am obviously changing the account)rgds,Miguel
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at https://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.