After this lesson, you will be able to: Explain how a web request travels from your browser to a server and back, and inspect that traffic with browser DevTools.
Before you build websites, it helps to understand how the web actually works. This lesson covers the client/server model, what HTTP requests and responses look like, the role of DNS, and how to peek under the hood with DevTools.
Every website is two computers talking. The client (your browser) asks for something. The server (a remote computer somewhere) replies with the answer. When you type bitree.dev into your browser, your computer sends a request across the internet. The server at the other end sends back HTML, CSS, JavaScript, and images. Your browser assembles them into the page you see.
Diagram coming soon!
Two boxes, "Client (your browser)" and "Server (somewhere on the internet)", connected by two arrows: a Request arrow going right (GET /) and a Response arrow coming back (200 OK + HTML)
Computers don't actually use names like bitree.dev, they use IP addresses (like 76.76.21.21). DNS (Domain Name System) is the system that translates names into IP addresses. When you type a URL, your computer first asks a DNS server "what's the IP for this name?" before making any request.
This is the actual text your browser sends. Most of it you never see, but DevTools will show it.
GET /lessons HTTP/1.1Host: bitree.devUser-Agent: Mozilla/5.0Accept: text/html# (no body for a GET request)
Status code on the first line, then headers, then the actual content.
HTTP/1.1 200 OKContent-Type: text/htmlContent-Length: 4521<!DOCTYPE html><html><head><title>Lessons</title></head><body>...</body></html>
Use Chrome or Firefox to watch a real request happen.
Open any website (try bitree.dev or wikipedia.org)
Right-click anywhere and choose "Inspect". DevTools opens
Click the "Network" tab
Reload the page (Cmd/Ctrl + R)
Click on the very first request in the list, look at Headers and Response
Find the status code (top of right panel)
Hint: think about which side of the conversation the problem is on.
Sign in and purchase access to unlock this lesson.