REST
Cheat sheet · https://pcornel.dk/topic.php?topic=5293
Answer
Resource-oriented HTTP API design using standard method semantics, representations and stateless request context.
Remember
- HTTP API ≠ REST automatically; an API can use HTTP while ignoring resource and method semantics.
- REST statelessness ≠ no server-side state; it means each request carries the context needed for that interaction.
- Resource URI ≠ database row; resources are interface abstractions and may aggregate or compute state.
- RESTful naming ≠ correct behavior; cache, idempotency, status and representation semantics still matter.
First checks
curl -sS https://<api>/v1/devices | jq '.[0]'— resource collectioncurl -sS https://<api>/v1/devices/<id>— single resource- Resource naming (nouns, plural) — design
Verify in this order
resource URL + method → representation
Where it usually breaks
A resource-style URL proves only naming; REST behavior depends on the interaction semantics and documented contract.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
REST 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=5293