Pcornel
Automation · APIs

GET

Cheat sheet · https://pcornel.dk/topic.php?topic=5295

Back to the Topic

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 — list
  • curl -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

BoundaryHealthy evidenceSuspicious evidence
Caller / requestEnvironment/version, identity and exact request contract are attributableHidden defaults, wrong endpoint/version, leaked or mismatched credentials
Server / responseStatus, headers, structured body and request ID are interpreted togetherStatus-only handling, ignored error body, ambiguous async result or unsafe retry
State / proofWrite result is reconciled with resource read-back or acceptance testResponse success treated as final target success without verification
TroubleshootingFirst failed boundary is preserved, changed minimally and retestedBlind 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

Confirmation

Confirm action

Continue?