The postal service of the web
Day 15 of 149
π Full deep-dive with code examples
Sending Mail
When you send a letter:
- Write your message
- Put in envelope with address
- Post office delivers it
- Recipient reads and replies
- Reply comes back to you
HTTP works the same way for websites!
How Web Pages Work
Your browser wants to see google.com:
Browser: "Dear Google, please send me your homepage"
β (travels over internet)
Google: "Sure! Here's the HTML, CSS, and images"
β (travels back)
Browser: "Got it!" (shows you the page)
This each way trip is an HTTP Request/Response.
The Message Format
Request (what you ask for):
GET /search?q=cats
Host: google.com
-
GET= I want to read something -
/search?q=cats= the specific page -
Host: google.com= who I'm asking
Response (what you get back):
200 OK
Content-Type: text/html
<html>Here's your page!</html>
-
200 OK= Success! β -
404 Not Found= Page doesn't exist β
Common HTTP Methods
| Method | What it does |
|---|---|
| GET | Read data |
| POST | Send new data |
| PUT | Update data |
| DELETE | Remove data |
In One Sentence
HTTP is the language browsers and servers use to send requests and receive responses over the web.
π Enjoying these? Follow for daily ELI5 explanations!
Making complex tech concepts simple, one day at a time.
Top comments (0)