Let's Get to Know HTTP: The Heart of Website Surfing! 🌐
Have you ever wondered how the data travels to each other? The answer is HTTP (Hypertext Transfer Protocol)! Let's see how this basic protocol works.
What is HTTP?
HTTP is simply a "language" that is used to talk between our web browser (Client) and the web server. When we type a URL on the browser, it sends a "Request" to the server, and the server sends a "Response" back with the information we need.
The communication structure of HTTP.
HTTP communication will consist of three main parts:
Request Line / Status Line: The first line that says "What are you doing" (for requests) or "What are the results?" (for responses)
Headers: Additional information needed for communication, such as the type of data sent, the website visited, or the browser used.
Body: Real data sent or received, such as an HTML file, image, or text.
A simple working example:
We type www.example.com in the URL box ➡️. The browser sends HTTP Request to the server.
The server searches for ➡️ data and sends back HTTP Response.
The browser showed us the web page www.example.com.
HTTP Methods: The command we use to talk to the server.
These commands will tell the server what we want to do with the information on the site:
GET: Retrieve data (e.g. read posts)
POST: Send data to create new stuff (e.g. subscribe, post a message)
PUT / PATCH: Modify existing data
DELETE: Delete data
HTTP Status Codes: Results of Communication
The server sends back a three-digit code to indicate the status of the request:
2x (Success): 200 OK ✅ request is successful
3xx (Redirect): 301 Moved Permanently ➡️ The data was moved elsewhere.
4xx (Wrong Side): 404 Not Found 🚫 You Can't Find Your Preferred Page
5xx (Wrong Server Side): 500 Internal Server Error 💀 Server Trouble
Summary
Understanding HTTP is an important basis for anyone whose work is involved in website development, because it will help us truly understand how the system works and solve more problems on the spot.
# Trending # Lemon 8 Howtoo # lemon 8 diary # Software # Technology






















































