Why is retrying a timed-out POST request different from retrying a GET request?
Quick answer
A timed-out GET can generally be retried because GET is idempotent: repeating it is not meant to add another effect. A POST is not guaranteed to be idempotent, so the server may have completed an action—such as creating a resource—even if you never received its response. Before repeating a POST, check that API’s documentation for an idempotency mechanism or a way to confirm the original outcome. [S1][S2]
The question, the details, the next step.
A practical checklist
Identify the exact POST endpoint and the action it may perform.
Treat a timeout as an unknown outcome, not proof that the action failed. [S2]
Check endpoint documentation for an idempotency mechanism and its required behavior. [S1]
Look for a documented way to confirm whether the original operation completed.
Retry only when the documented method makes repetition safe or you know the original was not applied. [S2]
Review client-library automatic retries before allowing them to repeat POST requests.
A few more useful answers
Does a timeout mean the POST request failed?
No. A timeout does not establish whether the server completed the work; the request may have taken effect even though the client received no response. [S2]
Is every POST unsafe to retry?
Not necessarily. An API may document an idempotency mechanism that makes a POST safe to repeat, but support and behavior depend on that API’s documentation. [S1]
Can I assume an API supports `Idempotency-Key`?
No. Check the specific API’s documentation for support and instructions; the existence of the header does not establish that a particular endpoint uses it. [S1]
Sources
References used for this guide.
- [S1] Idempotency-Key header — HTTP | MDN developer.mozilla.org · Checked
- [S2] 500, 502, 503, and 504 errors from APIs: what they mean and how to handle them learn.microsoft.com · Checked
