1. How the Web Works (HTTP Deep Dive)
How the Web Actually Works
Before you can build a backend, you need to understand the conversation that happens between your browser and a server. Every time you visit a website, send a message, or load an app, this exact conversation happens — usually in less than a second.
The Request-Response Cycle
Every single interaction on the web follows the same pattern:
asks for data
processes the request
receives the data
The Client is always the one asking. The Server is always the one waiting and answering. A server is just a computer that runs a program that does nothing but listen — patiently waiting for someone to ask it for something.
HTTP Methods (The Verbs)
The HTTP method tells the server what kind of action you want to perform. Think of these as verbs in a sentence.
Retrieve data. Never changes anything. Example: Loading a list of products.
Send new data to create something. Example: Creating a new user account.
Update existing data. Example: Changing your email address.
Remove existing data. Example: Deleting a post.
HTTP Status Codes (The Server's Reply)
Every response from a server includes a three-digit status code that tells you what happened.
200 OK = Everything worked201 Created = New resource made
400 Bad Request = You sent bad data401 Unauthorized = You need to log in403 Forbidden = You're logged in but not allowed404 Not Found = That URL doesn't exist
500 Internal Server Error = The server crashed502 Bad Gateway = Something broke in between
Example: When you visit https://api.example.com/users/5 If user exists → 200 OK with user data If user doesn't exist → 404 Not Found If you're not logged in → 401 Unauthorized If the server crashes → 500 Internal Server Error
Try It Yourself (Concept Check)
You don't need to write code yet. Just understand the logic:
Knowledge Check
Ready to test your understanding of 1. How the Web Works (HTTP Deep Dive)?