What is HTTP?
HTTP (Hypertext Transfer Protocol) is the standardized language of the web. It is the "glue" that allows your browser to talk to servers anywhere in the world.
Think of it like this: Imagine ordering a pizza. You (the client) call the shop (the server) and say "I want a Pepperoni" (the request). The shop makes it and brings it to your door (the response). The "Protocol" is the agreed-upon way you talk: you use a phone, speak a shared language, and follow a specific order.
Step 1 of 2
Syntax
METHOD /path HTTP/VERSIONWorked example
Request
GET /index.html HTTP/1.1
Host: example.comResponse
HTTP/1.1 200 OK
Content-Type: text/html
<html>...</html>This is the simplest possible exchange. The browser asks for the homepage, and the server says "OK" and hands over the HTML code.
How it works
HTTP follows a classic client-server model. A client (like your phone or laptop) opens a connection to a server, sends a message, and waits for a response. Once the response is received, the connection is usually closed (though modern versions like HTTP/2 and HTTP/3 keep it open for speed).
Statelessness
By default, HTTP is "stateless". This means the server doesn't remember you from your last request. To "remember" you (like staying logged in), we use things like Cookies or Tokens, which are sent inside HTTP Headers.
Study kit
Module 1 of 18
Beginner · 3 min · 0 of 18 complete
Module status
Not completed yet
Notessaved locally+
Notes stay in this browser. They are not uploaded.
Suggest an editLearning graph
Prerequisites
Discussion
Loading discussion…
Sign in to ask a question.