HTTP and HTTPS·Lesson 1 of 13

HTTP and HTTPS

01

The Language of the Web

Every time you open a website, your browser and the website's computer need to talk to each other. But how do they know what to say, and in what format? They use a shared language called (HyperText Transfer Protocol). HTTP is the set of rules that lets a web browser ask for a page and a web server send it back. It is the foundation of the entire web — every link you click and every image you load travels using HTTP.

The one-line version

HTTP is how a browser (the client) asks a web server for something, and how the server answers. HTTPS is the exact same thing with a lock on it — the conversation is encrypted so nobody in between can read or tamper with it.

🍽️

Like ordering at a restaurant

You (the browser) read the menu and ask the waiter for a dish. The waiter carries your order to the kitchen (the server) and brings back exactly what you asked for — or tells you it is sold out. Each order is a self-contained request, and you get one response back. HTTP works the same way: ask for something specific, get one answer.

02

Request and Response

HTTP follows a simple back-and-forth pattern called request–response. One side — the , usually your web browser — sends a request asking for something. The other side — the , the computer that stores the website — sends back a response. The client always speaks first; a server never sends a page unless something asked for it.

What happens when you visit a page

  • You type an address like example.com and press Enter
  • Your browser opens a connection to that website's server
  • The browser sends an HTTP request that means 'send me the home page'
  • The server finds the page and sends back an HTTP response containing it
  • Your browser reads the response and draws the page on your screen
03

Where HTTP Fits In

HTTP does not do everything by itself. It sits at the very top of a stack of helpers, each handling one job. HTTP decides what to ask for; the layers beneath it handle actually getting the message across the internet reliably. HTTP relies on to deliver its messages without errors, and TCP relies on to find the right computer across the internet. Here is that stack, top to bottom:

The web stack (top = what your app speaks)

HTTP / HTTPS

The rules for web requests and responses

Application

TLS

Encryption layer that HTTPS adds (skipped by plain HTTP)

Security

TCP

Delivers the data reliably and in order

Transport

IP

Addresses and routes packets across networks

Internet
04

From HTTP to HTTPS

Plain HTTP has one big weakness: everything it sends travels in the open. Anyone who can see the network traffic — someone on the same coffee-shop Wi-Fi, for example — can read the pages you load, the passwords you type, and the messages you send. (HTTP Secure) fixes this by wrapping the whole conversation in encryption using a technology called . The messages are exactly the same; they are just scrambled so only your browser and the real server can read them.

Here is how the two compare at a glance:

HTTPHTTPS
Full nameHyperText Transfer ProtocolHTTP Secure (HTTP over TLS)
EncryptionNone — sent as plain textEncrypted with TLS
Default port80443
Safe on public Wi-FiNo — anyone can read itYes — traffic is scrambled
Address starts withhttp://https://
Used by modern sitesRarelyAlmost always
05

What This Topic Covers

This topic builds HTTP up from the ground and finishes with how HTTPS secures it. You will see the exact shape of a request and a response, the methods and status codes they use, how sites remember you with cookies and sessions, how the protocol grew faster over the years, and finally how TLS locks the whole thing down. Every later section assumes only what you have read here, so you can go in order.

🚫

"HTTPS is a completely different protocol that replaces HTTP."

HTTPS is not a separate protocol. It is ordinary HTTP running inside an encrypted TLS tunnel. The requests, responses, methods, and status codes are identical — HTTPS simply adds a security layer around them.

Q:What is the difference between HTTP and HTTPS?

A: Both are the same request-response protocol for the web, but HTTPS adds encryption using TLS. HTTP sends data as plain text on port 80, so anyone in between can read it. HTTPS encrypts the data on port 443, so only the browser and server can read it, and it also confirms you are talking to the real server. Modern sites use HTTPS everywhere.

Quick Revision Cheat Sheet

HTTP: Rules for how browsers request and servers respond

Pattern: Request–response; the client always asks first

HTTPS: HTTP wrapped in TLS encryption

Ports: HTTP uses 80, HTTPS uses 443

Builds on: TCP for reliable delivery, IP for addressing

Rule of thumb: If it handles real user data, it must use HTTPS