Node.js · Senior · Question 65 of 75
How do idempotency keys make POST requests safe to retry?
- ✓Correct answer: The client sends a unique key; the server stores the result for that key and returns it for repeats instead of doing the work again
- 2The server rejects all repeated requests with 409
- 3They make POST work like GET
Explanation
Store the key with the request hash and the response, and handle concurrent requests with the same key (for example, with a lock).