← IGCSE Computer Science Paper 1

HTTP request and response

The browser sends an HTTP request asking for a page. The web server sends back an HTTP response with the page's HTML, or an error such as 404 page not found.

Understanding HTTP request and response in IGCSE Computer Science Paper 1

What it does: Status 200 OK means the request worked, and the response body holds the HTML for the browser to display. The server still replies. It sends an error response, for example 404 page not found, so the browser can tell the user. A server only responds after it has received a request, so the request always comes first.

Common mistakes: The web server answers with an HTTP response. The request is what the browser sends, so line 3 should be 'server sends HTTP response'. GIVE is not an HTTP method. A browser asks for a page with GET, so the line should be 'GET /about.html HTTP/1.1'.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 464–476) and word search (Modules 464–489).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which message does the browser send when you click a link to open a page?
An HTTP responseAn HTTP request
Matches
The web server sends the HTTP request and the browser sends the HTTP response.
↓
The roles are swapped: the browser sends the request and the web server sends the response.
Applying
Meanings
Term
HTTP request and response
Meaning
The browser sends an HTTP request asking for a page. The web server sends back an HTTP response with the page's HTML, or an error such as 404 page not found.
Practice
GET /shop.html HTTP/1.1
Testing
Gaps
/index.html HTTP/1.1
Check Answer
Spots
2server receives the request
3server sends HTTP request

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Constellation Wolf' badge — Space Legend, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which message does the browser send when you click a link to open a page?
A. An HTTP request ✓
B. An HTTP response
The browser always starts the exchange by sending a request asking for the page. The server then replies with a response.
2. Which device sends the HTTP response?
A. The web browser
B. The web server ✓
The web server sends the response back to the browser. The browser is the one that sends the request.
3. What does a successful HTTP response contain?
A. The address of the user's computer only
B. The HTML of the requested page ✓
A successful response carries the page's HTML, which the browser then renders as a web page.
4. The web server cannot find the page that was asked for. What does it send back?
A. An error response such as 404 page not found ✓
B. No reply, so the browser sends the page itself
The server still replies. It sends an error response, for example 404 page not found, so the browser can tell the user.
5. Which statement about HTTP is correct?
A. The browser sends a request and the server sends a response ✓
B. The server sends a request and the browser sends a response
In HTTP the browser is the client that asks (request) and the web server is the one that answers (response).

Match the Pairs

GET /index.html HTTP/1.1 → An HTTP request: the browser asks the web server for the page index.html
HTTP/1.1 404 Not Found → An HTTP error response: the web server cannot find the page that was requested
The web server replies to a successful request with a response containing the page's HTML → HTTP/1.1 200 OK <html>...</html>
The browser starts the exchange by sending a request that names the page it wants → GET /shop.html HTTP/1.1
The web server sends the HTTP request and the browser sends the HTTP response. → The roles are swapped: the browser sends the request and the web server sends the response.
HTTP/1.1 404 Not Found means the page was found and sent back. → 404 means the page was NOT found. A successful response uses 200 OK and contains the page's HTML.

Key Term

HTTP request and response
The browser sends an HTTP request asking for a page. The web server sends back an HTTP response with the page's HTML, or an error such as 404 page not found.

Fill in the Blanks

1. GET /index.html HTTP/1.1
Hint: Type the HTTP method the browser uses to ask the server for a page.
2. HTTP/1.1 200 OK
Hint: Type the status code the server sends when the request worked and the page is returned.
3. HTTP/1.1 404 Not Found
Hint: Type the status code for the error response when the page cannot be found.
4. Browser sends an HTTP request to the server
Hint: Type the word for the message the browser sends to ask for a page.
5. browser -> server: HTTP request server -> browser: HTTP response
Hint: Type the word for the message the web server sends back, containing the HTML or an error.

Spot the Error

Question 1
A browser sends HTTP request
B server receives the request
C server sends HTTP request
D browser displays the page
Line C — The web server answers with an HTTP response. The request is what the browser sends, so line 3 should be 'server sends HTTP response'.
Question 2
A GIVE /about.html HTTP/1.1
B Host: www.school.com
C Accept: text/html
Line A — GIVE is not an HTTP method. A browser asks for a page with GET, so the line should be 'GET /about.html HTTP/1.1'.
Question 3
A request = GET /shop.html
B page_exists = True
C status = 404
D send response with status
Line C — The page exists, so the server sends 200 (OK), not the 404 error. The line should be 'status = 200'.
Question 4
A HTTP/1.1 200 Not Found
B Content-Type: text/html
C <h1>Page not found</h1>
Line A — The status code and the message must match. 404 means Not Found, while 200 means OK. The line should be 'HTTP/1.1 404 Not Found'.
Question 5
A browser sends request for page
B server looks for the page
C page is missing
D server sends 200 OK response
Line D — The page is missing, so the server sends an error response (404 page not found). A 200 OK response is only sent when the page is found.

Student with a class code? Join your class →