freecoding.school100% FREE · NO SIGNUP
Endpoint BayISSUE #3 of 45

http basics · request · response

RestaVSThe 401 Bandit
Resta saysMost web APIs run on HTTP: a client sends a request, the server returns a response.

HTTP is the request/response protocol of the web. A request has a method, URL, headers, and optional body; a response has a status code, headers, and a body. It's stateless — each request stands alone, carrying whatever context (tokens, etc.) it needs. Understanding this round-trip is the foundation of every web API.

Power-ups you unlock

The 401 Bandit attacks — common mistakes

Boss battleLabel the four parts of an HTTP request for a login call.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>POST /login            ← method + URL
Content-Type: application/json   ← header
{ "email": "...", "pw": "..." }  ← body
→ 200 OK { "token": "..." }      ← response</pre></body></html>
▶ Open the interactive comic issue
‹ Why Apis · Machines Talking To MachinesHttp Methods · GET · POST · PUT · PATCH · DELETE ›