Asking for the page
What does your browser actually say to a website?
Once your browser has the site's number and a connection, it can ask for the page. It asks in HTTP, the set of rules browsers and websites share. An HTTP message is plain text that a person can read.
The browser sends an HTTP request, which works like a written order. It says three things:
- what to do:
GETmeans "send me this"; - which page:
/index.html; - which site:
example.com, because one server can hold many sites.
The server sends back an HTTP response, like the reply to that order. It starts
with a status code, which is like the stamp on the reply. 200 OK means "done,
here it is". The page itself comes after that.
Press play to read one request and its response, line by line.
Other status codes are other stamps. 404 Not Found means the site has no such page.
301 Moved Permanently means the page lives somewhere else now, and the browser goes there
instead.
This run used plain HTTP, so every line of it travelled in the open. Anyone on the way could read it too. The last lesson in this track shows how HTTPS fixes that.
Key takeaways
- Browsers and websites talk in HTTP: the browser sends a request, and the server sends a response.
- A request names what to do, which page and which site. GET means “send me this”.
- Every response starts with a status code, such as 200 for done or 404 for not found.