Automation · APIs
GET
Cheat sheet · https://pcornel.dk/topic.php?topic=5295
Answer
Retrieval of a current representation without intending to change server state.
Remember
- GET response 200 ≠ data current; caches, replication delay or stale backends can return old representations.
- GET ≠ harmless automatically; sensitive reads can expose data and poorly designed servers may trigger side effects.
- Empty result ≠ resource absent; filters, authorization or pagination may hide matching objects.
- Successful GET ≠ end-to-end application health; only the requested representation path was proven.
First checks
curl -sS 'https://<api>/v1/items?limit=50' | jq length— listcurl -sS -o /dev/null -w '%{http_code}' https://<api>/v1/items/<id>— status- Caching headers (ETag) — efficiency
Verify in this order
GET URL → 200 + body
Where it usually breaks
A successful GET proves retrieval for that request context; it does not prove freshness, completeness or absence of hidden resources.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
GET 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=5295