1. Concept library
  2. Backend with Node.js
  3. Module 2: HTTP fundamentals

Concept

Status codes

The status code tells the client what happened: 2xx success, 3xx redirect, 4xx the client's mistake, 5xx the server's. Choosing the right one lets clients and proxies behave correctly without reading the body.

What a session covers

The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.

  1. Explain what the 2xx, 3xx, 4xx and 5xx classes mean to a client
  2. Choose the status for created, not found, invalid input and a crash
  3. Spot the 200 with an error in the body and explain what it breaks

In practice

A few lines that show Status codes doing its job.

text
200 OK            a read or an update succeeded
201 Created       something new exists; Location header points to it
204 No Content    done, nothing to return (a delete)
400 Bad Request   the request is malformed or fails validation
401 Unauthorized  no valid credentials
403 Forbidden     valid credentials, not allowed
404 Not Found     no such resource (or hide that it exists)
409 Conflict      the change clashes with current state
429 Too Many Requests
500 Internal Server Error   a bug; never the client's fault

The common mistake

Watch for

Returning 200 with { "error": "not found" } in the body. Caches store it as a success, clients retry logic is skipped, and monitoring sees a healthy endpoint.

What to know first

Your roadmap puts these before Status codes, unless you already know them.

How it stays learned

Once a session shows you understand Status codes, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.

  1. Day 3First recall, while it is fresh
  2. Day 7Second, a week on
  3. Day 18Last, when it has settled

Where it leads

Topics that build on Status codes.

Previous in the module← Requests and responses