16.5 The Web: HTTP, HTML and Markup Languages, Browsers, Servers, and Clients
Key Takeaways
- The Web is one service that runs on the Internet: a system of linked documents and applications, identified by URLs and transferred with HTTP.
- HTTP is a request–response protocol: a client sends a request, such as GET /index.html, and the server returns a status code (200 OK, 404 Not Found, 500 Server Error) and content.
- HTML is a markup language that uses tags to describe the structure and meaning of content; CSS controls presentation, and JavaScript adds behavior.
- A web server stores and delivers web resources, and may generate pages dynamically, in response to HTTP requests from clients.
- A browser is a client application that requests resources, renders HTML and CSS, runs JavaScript, and manages cookies, caching, and security checks such as HTTPS certificates.
What this competency asks
ETS asks you to be familiar with the components that make up the Web (for example, HTTP, HTML, browsers, servers, and clients):
- Identify the uses of markup languages.
- Identify the purposes of browsers, servers, and clients.
ETS's sample question asks which statement best describes a web server. The answer: a computer system that delivers web pages to clients. The distractors describe a router (finding paths), a web-design tool (creating pages), and a DNS server (translating names to IP addresses).
The Internet vs. the Web
- The Internet is the global network of networks, the infrastructure of routers, links, and the IP protocol (Sections 16.1–16.4).
- The World Wide Web is one service that runs on the Internet: linked documents and applications identified by URLs and transferred with HTTP. Tim Berners-Lee proposed it at CERN in 1989.
Email, video calls, online games, and file transfers also use the Internet, but they are not the Web.
Clients and servers
| Role | What it does | Examples |
|---|---|---|
| Client | Initiates requests for resources or services | A browser; a mobile app; a smart speaker requesting a forecast |
| Server | Waits for requests and responds, often to many clients at once | A web server (such as Apache or nginx) delivering pages; application servers running code; database servers |
"Server" can mean the software that answers requests or the computer that runs it. One computer can run several server programs.
What a web server does
- Stores and delivers static resources: HTML files, images, stylesheets, scripts.
- Generates dynamic pages by running server-side code and querying databases, as for a gradebook page built for each student.
- Handles HTTPS, logs requests, and enforces access control.
What a browser does
- Turns a URL into requests: it looks up the domain with DNS, connects to the server, and sends HTTP(S) requests.
- Renders HTML and CSS into the visible page and runs JavaScript for interactivity.
- Requests every additional resource the page references, such as images, CSS, and scripts.
- Manages cookies, caching, bookmarks, and history.
- Enforces security: checks HTTPS certificates (the padlock), isolates sites from one another, and warns about dangerous sites.
HTTP: the Web's protocol
HTTP is a request–response protocol:
Client request:
GET /classes/cs101.html HTTP/1.1
Host: www.example.edu
Server response:
HTTP/1.1 200 OK
Content-Type: text/html
<!DOCTYPE html> …
| Method | Purpose |
|---|---|
| GET | Retrieve a resource (loading a page) |
| POST | Send data to the server (submitting a form) |
| PUT / DELETE | Update or remove a resource (common in web APIs) |
| Status code | Meaning |
|---|---|
| 200 OK | Success |
| 301 / 302 | Redirect to another URL |
| 403 Forbidden | The server refuses access |
| 404 Not Found | No resource exists at that path |
| 500 Internal Server Error | The server failed while handling the request |
HTTP is stateless. Each request stands alone. To remember a logged-in user or a shopping cart, sites use cookies or session tokens that the browser sends with later requests (Section 3.3 discusses tracking cookies). HTTPS is HTTP inside an encrypted TLS connection. The server proves its identity with a digital certificate (Section 16.6).
Markup languages
A markup language adds tags to text to describe its structure and meaning. It is not a programming language: it has no loops or variables.
<!DOCTYPE html>
<html lang="en">
<head>
<title>CS 101</title>
</head>
<body>
<h1>Welcome to CS 101</h1>
<p>Read the <a href="syllabus.html">syllabus</a> first.</p>
<img src="lab.jpg" alt="Students working in the computer lab">
</body>
</html>
- Elements are marked by tags (
<p>…</p>). Attributes add information (href,src,alt). - Semantic tags such as
<h1>,<nav>, and<button>help browsers, search engines, and screen readers understand the page (Section 2.2).
| Language | Use |
|---|---|
| HTML | Structure and content of web pages |
| XML | Storing and exchanging structured data with custom tags |
| SVG | Vector graphics described in XML |
| Markdown | Lightweight formatting for documentation and notes |
Separation of concerns
| Technology | Role |
|---|---|
| HTML | Structure: what the content is |
| CSS | Presentation: how it looks (colors, fonts, layout) |
| JavaScript | Behavior: what happens when users interact |
Keeping the three separate makes sites easier to maintain and more accessible. A page can be restyled by changing only its CSS.
What happens when you visit a URL
- The browser parses the URL (Section 16.4).
- DNS resolves the domain to an IP address.
- The browser opens a TCP connection, and for HTTPS, a TLS session that verifies the certificate.
- It sends an HTTP GET request.
- The server responds with a status code and HTML.
- The browser renders the HTML, then requests the CSS, JavaScript, and images it references.
- JavaScript may send further requests to web APIs (Section 11.3) as the user interacts.
Which statement best describes a web server?
What is the primary use of a markup language such as HTML?
A student clicks a link and the browser shows "404 Not Found." What does this status code indicate?
Which statement correctly distinguishes the Internet from the World Wide Web?