POST
Cheat sheet · https://pcornel.dk/topic.php?topic=5296
Answer
Submission of a representation or command that commonly creates a subordinate resource or triggers a non-idempotent action.
Remember
- POST accepted ≠ action completed; 202 or asynchronous workflows can defer the real outcome.
- POST retry ≠ safe automatically; duplicate creates or repeated side effects are common without an idempotency key.
- 201 Created ≠ representation validated by the caller; Location and body still need checking.
- Same payload ≠ same operation; server-generated identity or current state can change the result.
First checks
curl -sS -X POST -H 'Content-Type: application/json' -d @payload.json https://<api>/v1/items— create- 201 Created + Location header — result
- Idempotency-Key header (if supported) — safe retry
Verify in this order
POST body → server creates → 201 + Location
Where it usually breaks
POST success proves only that the server accepted or processed that submission path; it may not prove a unique or completed side effect.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
POST API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5296