← All pathways

How APIs Actually Work

Past curl and Postman to what is really happening on the wire.

You use APIs every day but the under-the-hood picture stays fuzzy: what an endpoint really is, where the front-end/back-end line sits, and how it all gets secured. This pathway walks from the core concept, to how an endpoint is exposed and protected, to seeing it live in your terminal.

You can already call an API — what's missing is the model underneath. This route follows one thing, a request, from what it fundamentally is, through how it travels and gets secured, to watching it happen in your own terminal. Ten lessons across three sites, in order; each stands alone, but together they close the loop.

10 steps live · 3 sites

What you'll be able to do

  • Explain what an API really is — a contract, not code — and where the front-end/back-end line actually falls.
  • Trace a request end to end: DNS, ports, TLS termination, the gateway, and the handler that answers.
  • Reason about API security the way production does: tokens, the authentication/authorization split, and mTLS as the default.
  • Inspect real traffic with curl -v and the browser network tab — and read what you find.
01

Start with the contract

02

Follow a request

3

From URL to Endpoint: How an API Gets Exposed

Networking · Essentials

What "expose an endpoint" really means: DNS, ports, and binding.

'Expose an endpoint' hides four real stages: DNS resolving a name to an address, a port acting as the door, a bind decision (localhost vs. the world), and a path routing to the code that answers. Each stage fails differently, so knowing which one broke turns a vague symptom into a specific fix.

4

Why HTTP APIs Forget You: Statelessness

Computer Science · Efficiency

Why every request re-introduces itself — and where state lives.

HTTP servers are deliberately stateless, which is what lets any server handle any request and the web scale horizontally. The cost is that identity has to be re-proven on every single call — the entire reason sessions, cookies, and tokens exist.

5

Anatomy of an HTTP Request and Response

Computer Science · Efficiency

Methods, status codes, headers, body — the contract in detail.

Every HTTP message reduces to four parts with fixed jobs: a method (the verb), a path (the noun), headers (metadata), and a body (payload) — answered by a status code, more headers, and a payload. Learn the four slots and "design an endpoint" stops being a mystery.

6

Seeing API Traffic: curl -v and the Network Tab

Dev Tools · Essentials

Watch the anatomy you just learned on real, live traffic.

curl -v and the browser Network tab expose the exact anatomy from the last step on real, live traffic — handshakes, headers, redirects, and preflights you have been trusting on faith. Reading the whole conversation, not just the response body, turns "the API is being weird" into a specific fact.

03

Expose it safely

7

Authentication vs Authorization in APIs

Computer Science · Efficiency

Who you are vs what you may do — and where each check happens.

Authentication answers "who are you"; authorization answers "what may you do" — two separate checks that belong in different places, since identity can be offloaded to a gateway but permission checks belong in the service that owns the resource. Conflating them is the root cause behind most broken-access-control vulnerabilities.

8

HTTPS for APIs: Where the Connection Gets Secured

Networking · Essentials

TLS termination: where encryption actually stops in production.

"Put it behind HTTPS" is the start of securing an API in transit, not the end — the real question is where the lock comes off and what protects every hop after it. The current standard answer is mTLS on every leg, not "trust the internal network."

9

Reverse Proxies and API Gateways

Networking · Efficiency

The front door that owns the public address and guards your services.

In production your backends are not directly exposed — a single reverse proxy or API gateway owns the public address, terminates TLS, routes by path, and authenticates callers before traffic ever reaches your code. "Is this endpoint exposed?" becomes a question about the gateway config, not your service.

10

CORS Explained: The Front-End/Back-End Border

Networking · Efficiency

The browser rule that makes APIs "work in curl but not the app."

CORS is not the browser being difficult — it is the browser protecting your users by refusing, by default, to let an arbitrary site spend their credentials against your API without permission. The fix for a CORS error is always a specific server-side header, never a client-side workaround.

04

Go deeper

11

API Design Principles: REST, Idempotency, Versioning

coming soonComputer Science · Mastery

The decisions you cannot take back once clients depend on you.

REST conventions, idempotency guarantees, and a versioning strategy are the decisions you cannot unmake once real clients depend on your contract. Reserved for the paid Mastery tier — coming soon.