News for hackers. Stuff that matters.
Re:Difference between PUT vs. POST from a system administrat... by Solitude042 on Saturday October 14, 2023 @01:17AM (#37878260)
In the context of REST, idempotency is about duplicate requests not causing the system state to change further after the first request. For example, a POST might create a new resource each time, whereas a PUT would replace an existing resource. The POST changes the system with each call & created resource (not idempotent), whereas PUT likely wouldn't change the resource if the same content was PUT repeatedly (idempotent).

Idempotency provides resilience against messages that might be repeated (e.g., at-least-once delivery).

Idempotent operations are also typically structured as absolute, not relative data.

For example, a bank might send a message "set balance to $100", not "subtract $10 from balance" - if the message is repeated, the correct result is still obtained.

There are no comments on this comment yet.