Course contentsShow
Web Development
Lesson 9 of 2,9821. The Web Platform FoundationFree lesson

Status Codes: What the Server Says Back

Understanding HTTP status codes like 200, 404, and 500 and what they communicate about the request.

Status Codes: What the Server Says Back

What you'll learn: How servers use three-digit codes to tell your browser whether a request succeeded, failed, or needs something else.

The Server's Response Language

When you send an HTTP request (like using GET to fetch a webpage), the server doesn't just send back data—it also sends a status code. Think of it like a text message reply: instead of just answering your question, someone might start with "Good news!" or "Sorry, can't help." Status codes work the same way—they're the server's quick summary of what happened.

The Three Main Status Code Families

2xx: Success

  • 200 OK – "Here's exactly what you asked for!" This is the happy path. Your request worked perfectly.

4xx: Client Errors

  • 404 Not Found – "That page doesn't exist." You've probably seen this one! It means the URL you requested isn't on the server.
  • 403 Forbidden – "That exists, but you can't access it."

5xx: Server Errors

  • 500 Internal Server Error – "Something broke on my end." The server encountered a problem it couldn't handle.

Why Status Codes Matter

Your browser uses these codes to decide what to do next. A 200 means "display the page." A 404 means "show an error message." Even though you don't always see the number, it's happening behind the scenes in every request-response cycle.

Status codes are like receipt confirmations—they let you know if your request was processed successfully, rejected, or lost in transit.

Key Takeaway: Status codes are three-digit numbers servers send back to communicate whether your HTTP request succeeded (200), you made a mistake (404), or the server had a problem (500).