Core question: How do a client and a server actually talk to each other step-by-step?
In the previous lesson, we met the two main actors on the internet: the Client and the Server. Now, how do they actually communicate?
Every single action you take online—clicking a link, liking a photo, logging into your bank account, or searching for a song—follows a strict, predictable rhythm called the Request ↔ Response Cycle:
The Golden Rule: In standard web communication, the server never speaks first. It sits quietly waiting. A conversation only happens when a client initiates a request, and once the server sends its response, that single cycle is complete.
When you click a button or type a web address, your browser doesn't just shout across the internet. It packs a neatly formatted digital envelope called an HTTP Request.
Every request envelope has four key parts:
| Part | Analogy | What It Does | Example |
|---|---|---|---|
| 1. URL (Endpoint) | The street address on the envelope | Tells the internet which server and which specific resource you are asking for. | https://example.com/profile |
| 2. Method (Verb) | The intent sticker ("Order", "Return", "Inquiry") | Tells the server what action you want to perform on that resource. | GET, POST, PUT, DELETE |
| 3. Headers | The return address & special handling notes | Extra metadata about the request—what browser you're using, your preferred language, or your login token. | Accept-Language: en-US |
| 4. Body (Payload) | The letter inside the envelope | (Optional) The actual data you are sending to the server. Empty when just reading a page; full when submitting a form. | {"username": "alex", "Bio": "Dev"} |
GET (Read): "Please give me this data." (Used when loading a webpage, viewing a profile, or searching).POST (Create): "Here is brand-new data; please save it." (Used when signing up, posting a comment, or uploading a photo).PUT / PATCH (Update): "Please modify data that already exists." (Used when editing your profile bio or changing a password).DELETE (Delete): "Please remove this data." (Used when deleting a post or removing an item from a cart).Once your request travels across the internet and arrives at the server, the server doesn't just bounce an answer back blindly. In a fraction of a second (often 20 to 200 milliseconds), the server:
GET, POST, etc.), the Headers, and the Body.