HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
The Internet, the Web and How Pages Reach You
  1. 1The internet, the world wide web and URLs
  2. 2HTTP, HTTPS and the web browser
  3. 3Finding a web page: DNS, web servers and cookies
  1. Computer Science
  2. /The Internet, the Web and How Pages Reach You
  3. /HTTP, HTTPS and the web browser

Course 5.1·Lesson 2 of 3

HTTP, HTTPS and the web browser

A browser and a web server talk with a set of rules called HTTP. HTTPS is the same set of rules with the data encrypted. This lesson shows how a request and a response work, why HTTPS matters, and what jobs a web browser does.

about 25 min1 simulation1 practice question
Lesson 2 of 3Show all lessonsHide
The Internet, the Web and How Pages Reach You
  1. 1The internet, the world wide web and URLs
  2. 2HTTP, HTTPS and the web browser
  3. 3Finding a web page: DNS, web servers and cookies

Try the code and the simulations beside the lesson.

A request and a response

Think of a library with a desk. You ask the librarian for a book by its name. The librarian finds it and hands it over, or says that the library does not have it. A browser and a web server work in the same way.

The web server is a computer that stores websites and sends their pages out. The web browser is the program on your device that asks for pages and shows them.

Hypertext transfer protocol (HTTP) is the set of rules for sending web pages between a web server and a browser. Its purpose is to make sure that both sides understand each other.

  1. The browser sends an HTTP request to the web server. The request names the page it wants.
  2. The web server finds the page. It sends back an HTTP response. The response holds the page, written in HTML, or a message that the page was not found.
  3. A web page often has other files too: pictures, styles and programs. The browser sends a separate request for each file.
A web browser on the left and a web server on the right, with four arrows between them. From the top: an arrow from the browser to the server labelled HTTP request: GET /news.html; an arrow back labelled HTTP response: the page in HTML; then, in red, an HTTPS request and an HTTPS response, each labelled encrypted with SSL. A note under them says that HTTPS is the same request and response, but encrypted.

Why one page can need many requests

Each file needs its own request and response, and each one takes time to go there and back. Suppose a page has 121212 files and each request and response takes 50 ms50\ \text{ms}50 ms (milliseconds). One at a time, the page takes 12×50=600 ms12 \times 50 = 600\ \text{ms}12×50=600 ms. A browser can send several requests at the same time, so it needs fewer rounds.

HTTPS: the secure version

HTTP sends its data as plain text. Anyone who intercepts the data on its way can read it, and that may include a password or a card number. You meet this threat, data interception, in the course on cyber security.

Hypertext transfer protocol secure (HTTPS) is HTTP with encryption added. It uses a security protocol called secure socket layer (SSL). Before any page is sent, the browser and the web server agree how to encrypt the data. Then every request and every response travels encrypted. Data that is intercepted cannot be understood without the key.

  • The URL starts with https instead of http.
  • Most browsers show a small padlock in the address bar.
  • The web server proves who it is with a digital certificate, so the browser knows it is talking to the real website.

You saw symmetric and asymmetric encryption in the chapter on data transmission. HTTPS uses them. The newer form of SSL is called TLS, but the idea is the same.

What a web browser does

The main purpose of a web browser is to render HTML and display web pages. To render means to read the HTML code and turn it into the page you see: the headings, the text, the pictures and the links.

A browser has other functions too.

  • It stores bookmarks and favourites, so you can go back to a page quickly.
  • It records your history, the list of pages you have visited.
  • It allows multiple tabs, so several pages are open at the same time.
  • It stores cookies, small files that websites ask it to keep. The next lesson explains them.
  • It provides navigation tools: back, forward, reload and home.
  • It provides an address bar, where you type a URL or see the address of the page.

Practise with new numbers

Try it in Python

The program plays both parts. A dictionary holds the pages of a small web server. The function web_server gets a request such as GET /news.html and returns a response. GET is the word HTTP uses to ask for a page. The status 200 OK means the page was found, and 404 Not Found means it was not.

Read it first. Then run it. Which request gets the page, and which one gets the error?

1. Add a page /sport.html to the dictionary. Run it again: what changes in the second response?

2. Send a request for /index.html as well. Predict the response before you run it.

Common mistakes

  • Saying HTTPS makes a website safe in every way. HTTPS encrypts the data on its way. A fake website can also use HTTPS, so you still check the URL.
  • Thinking the browser stores the website. The web server stores it. The browser asks for each page and shows it.
  • Forgetting that the response can be an error. If the page is not there, the server says so.
  • Mixing up rendering and storing. Rendering is turning HTML into the page on the screen.

Remember these

  • HTTP is the set of rules for sending web pages between a web server and a browser, by request and response.
  • HTTPS is HTTP with the data encrypted, using the SSL security protocol.
  • The main purpose of a browser is to render HTML and display web pages. It also stores bookmarks, history and cookies, allows tabs and gives navigation tools and an address bar.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. What does a web server send back when it gets an HTTP request for a page that it holds?
  1. Ali logs in to a website whose URL begins with http://. Why is this a risk?
  1. A page has 999 files. Each request and response takes 40 ms40\ \text{ms}40 ms. The browser sends 333 requests at the same time. How long does the page take to load?
  1. Name two functions of a web browser apart from showing pages.
  1. What is the main purpose of a web browser?

Enroll free in The Internet, the Web and How Pages Reach You

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

A news page is made of 20 files: the HTML, 15 pictures and 4 other files…Medium · High School (9–10) · by StemPy Lab
A small club sets up a website. Members log in with a username and a password…Medium · High School (9–10) · by StemPy Lab
Name the function of the web browser that helps in each case…Easy · High School (9–10) · by StemPy Lab
Next: lesson 3Finding a web page: DNS, web servers and cookies
← The Internet, the Web and How Pages Reach You
← The internet, the world wide web and URLsFinding a web page: DNS, web servers and cookies →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.