CORE/learn/http-basics
NETWORK_SYNC_ACTIVE
BACK_TO_MAP
DOMAIN::fundamentalsAPI Fundamentals
HTTP Basics
"Methods, Headers, and Status Codes."
Real_World_Analogy
Sending a letter: the address is the URL, the stamp is the header, and the content is the payload.
Constraints_&_Tradeoffs
- Status codes carry the outcome; a 200 with an error body breaks every generic client.
- Methods differ in safety and idempotency, and caches and proxies act on those properties.
INTERACTIVE_TRACE
TRACE::MESSAGE_ANATOMY
METHOD::MESSAGE_ANATOMYhttp-basics
REQUEST
START_LINE
GET /articles/<article-id> HTTP/1.1
method, target and version — the one line a proxy must parse
HEADERS
Host: api.example Accept: application/json
metadata about the message: content type, credentials, caching directives
BODY
— none: the method only asks for a representation —
the representation itself; absent for methods that only describe an intent
SAFE::YESIDEMPOTENT::YESCACHEABLE::YES
RESPONSE
STATUS_LINE
HTTP/1.1 200 OK
2xx accepted, 4xx the caller must change something, 5xx the server must
HEADERS
Content-Type: application/json Cache-Control: <directives>
this method is cacheable, so the directives here actually matter
accepted — the outcome is in the response body
RETRY_READS_THE_STATUS
GET is idempotent: a client may repeat it after a timeout without changing the outcome
Illustrative_Specimen
GET /articles/<article-id> HTTP/1.1 Host: api.example Accept: application/json --- HTTP/1.1 200 OK Content-Type: application/json
Placeholders in <angle-brackets>. Illustrative message shapes, not a description of any specific API.