HTTP and HTTPS
HTTP and HTTPS
Communication between clients and servers happens through a protocol called HTTP.
Understanding HTTP is essential because every web request you make uses it.
What is HTTP?
HTTP stands for HyperText Transfer Protocol.
It is a set of rules that define how data is sent between a client and a server.
When you visit a website, your browser sends an HTTP request, and the server responds with an HTTP response.
How HTTP Works
HTTP follows the request–response model:
- The client sends a request
- The server processes the request
- The server sends back a response

This happens every time you load a page, submit a form, or fetch data from an API.
Structure of an HTTP Request
An HTTP request typically includes:
- Method (GET, POST, etc.)
- URL or path
- Headers (metadata about the request)
- Body (optional data sent to the server)

Structure of an HTTP Response
An HTTP response includes:
- Status code (e.g., 200, 404)
- Headers (metadata about the response)
- Body (the actual content)

What is HTTPS?
HTTPS stands for HyperText Transfer Protocol Secure.
It is the secure version of HTTP.
The key difference is:
- HTTP → data is sent in plain text
- HTTPS → data is encrypted
Why HTTPS Matters
HTTPS protects data as it travels between the client and server.
This is important for:
- Login forms
- Payments
- Personal data
- API requests
Without HTTPS, data can be intercepted.
Key Idea
HTTP defines how communication happens.
HTTPS makes that communication secure.
Modern web applications always use HTTPS.
Summary
- HTTP is the protocol used for web communication
- It follows a request–response model
- Requests and responses have structured formats
- HTTPS encrypts data for security
In the next lesson, you’ll explore the request–response cycle in more detail.