- 2069 Chaitra · 2+6 marks
HTTP request served by server
Short answer
HTTP is a stateless client-server protocol over TCP, using port 80 or 443. A client sends a request line like GET /index.html HTTP/1.1 with headers, and the server replies with a status line, headers, and body, such as HTTP/1.1 200 OK with the HTML page.
What is HTTP protocol? With an example explain how a request initiated by an HTTP client is served by an HTTP server.
HTTP (HyperText Transfer Protocol) is the application-layer protocol of the World Wide Web. It follows the client-server model: a client (browser) sends a request and a server sends a response. It uses TCP, port 80 (HTTPS, port 443). HTTP is stateless: the server does not remember earlier requests (cookies add state).
Example: user opens http://www.abc.com/index.html
- The browser asks DNS for the IP address of www.abc.com (say 10.1.1.5).
- The browser opens a TCP connection to 10.1.1.5 port 80 (three-way handshake).
- The browser sends the request:
GET /index.html HTTP/1.1
Host: www.abc.com
User-Agent: Mozilla/5.0
Accept: text/html
Connection: keep-alive
- The server parses the request line, finds the file, and sends the response:
HTTP/1.1 200 OK
Date: Thu, 08 Oct 2026 10:00:00 GMT
Server: Apache
Content-Type: text/html
Content-Length: 2048
<html> ... </html>
- The browser reads the HTML. For each embedded object (images, CSS), it makes more requests, over the same connection if persistent (HTTP/1.1).
- The connection is closed (or kept for the next request) and the page is displayed.
Client Server
|---- TCP handshake ---->|
|---- GET /index.html -->|
|<--- 200 OK + HTML -----|
|---- GET /logo.png ---->|
|<--- 200 OK + image ----|
Parts of a message
- Request: request line (method, URL, version), headers, blank line, optional body. Methods: GET, POST, HEAD, PUT, DELETE.
- Response: status line (version, code, phrase), headers, blank line, body.
- Status codes: 1xx informational, 2xx success, 3xx redirection, 4xx client error (404), 5xx server error (500).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Server before client; TCP reliability · Computer Networks and Security, chapter 5 · asked 2×
- Client-server vs peer-to-peer · Computer Networks and Security, chapter 1
- Features of client/server architecture · Computer Networks and Security, chapter 1
- HTTP request methods; web server and virtual hosting · Internet and Intranet, chapter 4
- Client-side versus server-side scripting · Web Technology, chapter 3 · asked 3×
- Short note: Client-Server and Master-Slave · Big Data Technologies, chapter 1
- Client/server architecture and FTP operation · Internet and Intranet, chapter 3