API Design · Senior · Question 64 of 75
Why should timeouts be part of an API's documented contract?
- 1HTTP has no timeouts
- 2Timeouts are an internal detail
- ✓Correct answer: Clients need to know how long the server may take and what happens on timeout (was the work done?), to set their own timeouts and retries
Explanation
For long work, the contract should switch to async operations instead of long timeouts.