HTTP & REST API Fundamentals
Cheat sheet · https://pcornel.dk/topic.php?topic=94
Answer
HTTP REST APIs expose resources at URLs and use methods to act on them: GET reads, POST creates, PUT/PATCH update, DELETE removes. Status codes report the result (2xx success, 4xx client error, 5xx server error); GET, PUT and DELETE are idempotent.
Remember
HTTP success describes the response semantics for a request. It is not independent proof of correct permissions, durable network configuration or service behavior.
First checks
curl -i -H "Accept: application/json" https://host/api/resource → status line, headers and body. After a POST, PUT or PATCH, GET the resource again to confirm the change. 4xx = fix the request; 5xx = problem on the server.
Verify in this order
URL and method chosen → headers set (Accept, Content-Type, Authorization) → request sent over HTTPS → status code class (2xx, 4xx, 5xx) → body parsed → GET again to confirm a change
Where it usually breaks
physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=94