|
|
|
|
|
by Solitude042
978 days ago
|
|
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. |
|