HTTP 1 Vs 1.1 Vs 2.0 Vs 3.o
HTTP 1 Vs 1.1 Vs 2.0 Vs 3.o
0 (1996)
✅ Key Features:
📦 Example:
📦 Example:
Client loads a full HTML page and images over a single TCP connection:
Then:
✅🔹 HTTP/2 (2015)
✅ Key Features:
📦 Example:
❌ Limitation:
Still uses TCP, which suffers from head-of-line blocking at the transport level.
✅🔹 HTTP/3 (2022)
✅ Key Features:
📦 Example:
✅ Benefit:
⚠️Note:
🔁 Summary Comparison
HTTP/
Feature HTTP/1.1 HTTP/2 HTTP/3
1.0
✅ (Multiplexed over
Connection reuse ❌ ✅ (Keep-Alive) ✅ (Multiplexed)
QUIC)
Request
❌ Limited ✅ ✅
pipelining
Server Push ❌ ❌ ✅ ✅
Optional Optional
Encryption ❌ Mandatory
(HTTPS) (HTTPS)
http
<!DOCTYPE html>
<html>
<head>
<title>Welcome</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is a basic HTML page served over HTTP/1.0.</p>
</body>
</html>
HTTP/1.0 200 OK: Status line – version, status code, reason phrase
Date: Date and time the response was sent
Server: Information about the server
Content-Type: MIME type of the response body
Content-Length: Size in bytes of the body
Connection: close: Signals the connection will be closed after the response
(default behavior in HTTP/1.0)
🔁 Behavior in HTTP/1.0:
username=alice&password=secret
🔍 Explanation of Request Segments:
Segment Description
HTTP/1.0 200 OK
Date: Sun, 18 May 2025 12:00:00 GMT
Server: Apache/1.3.41 (Unix)
Content-Type: text/html
Content-Length: 122
Connection: close
<html>
<head><title>Success</title></head>
<body>
<h1>Form submitted successfully</h1>
</body>
</html>
🔍 Response Segments:
Segment Description
{
"id": 123,
"name": "Updated Item",
"price": 45.99
}
🟩 Response (Server Response)
HTTP/1.0 200 OK
Date: Sun, 18 May 2025 13:00:00 GMT
Server: Apache/1.3.42
Content-Type: application/json
Content-Length: 36
Connection: close
HTTP/1.0 200 OK
Date: Sun, 18 May 2025 13:05:00 GMT
Server: Apache/1.3.42
Content-Type: application/json
Content-Length: 36
Connection: close
🔍 Summary Table
Method Purpose
HTTP/1.1 200 OK
Date: Sun, 18 May 2025 11:00:00 GMT
Server: Apache/2.4.58 (Ubuntu)
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Content-Length: 512
Cache-Control: max-age=3600
ETag: "abc123etag"
Last-Modified: Sat, 17 May 2025 14:00:00 GMT
Connection: keep-alive
Vary: Accept-Encoding
<!DOCTYPE html>
<html>
<head>
<title>Product Details</title>
</head>
<body>
<h1>Item #123</h1>
<p>This is a sample product page.</p>
</body>
</html>
🔍 Explanation of Response Segments:
Segment Description
HTTP/1.1 200 OK Status line: protocol version, status code, reason phrase
🔁 Behavior in HTTP/1.1
Persistent connections by default via keep-alive
Chunked transfer encoding supported when size is unknown
Much better header support than HTTP/1.0
Host header is mandatory
⚙️HTTP/1.1 (Text-Based)
🔷 GET Request
GET /api/products/123 HTTP/1.1
Host: www.example.com
User-Agent: CustomClient/1.1
Accept: application/json
Connection: keep-alive
✅ Response
HTTP/1.1 200 OK
Date: Sun, 18 May 2025 13:30:00 GMT
Content-Type: application/json
Content-Length: 51
Connection: keep-alive
{
"id": 123,
"name": "Sample Item",
"price": 25.50
}
🔷 POST Request
POST /api/products HTTP/1.1
Host: www.example.com
User-Agent: CustomClient/1.1
Content-Type: application/json
Content-Length: 52
Connection: keep-alive
{
"name": "New Product",
"price": 39.99
}
✅ Response
HTTP/1.1 201 Created
Date: Sun, 18 May 2025 13:31:00 GMT
Location: /api/products/124
Content-Type: application/json
Content-Length: 38
Connection: keep-alive
🔷 PUT Request
PUT /api/products/123 HTTP/1.1
Host: www.example.com
User-Agent: CustomClient/1.1
Content-Type: application/json
Content-Length: 51
Connection: keep-alive
{
"id": 123,
"name": "Updated Item",
"price": 45.99
}
✅ Response
HTTP/1.1 200 OK
Date: Sun, 18 May 2025 13:32:00 GMT
Content-Type: application/json
Content-Length: 36
Connection: keep-alive
🔷 DELETE Request
DELETE /api/products/123 HTTP/1.1
Host: www.example.com
User-Agent: CustomClient/1.1
Connection: keep-alive
✅ Response
HTTP/1.1 200 OK
Date: Sun, 18 May 2025 13:33:00 GMT
Content-Type: application/json
Content-Length: 36
Connection: keep-alive
🔷 OPTIONS Request
OPTIONS /api/products HTTP/1.1
Host: www.example.com
User-Agent: CustomClient/1.1
Connection: keep-alive
✅ Response
HTTP/1.1 204 No Content
Allow: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Connection: keep-alive
Content-Length: 0
🔷 GET (HTTP/2)
:method: GET
:scheme: https
:authority: www.example.com
:path: /api/products/123
accept: application/json
✅ Response:
:status: 200
content-type: application/json
content-length: 51
{"id":123,"name":"Sample Item","price":25.50}
🔷 POST (HTTP/2)
:method: POST
:scheme: https
:authority: www.example.com
:path: /api/products
content-type: application/json
content-length: 52
✅ Response:
:status: 201
location: /api/products/124
content-type: application/json
✅ PUT / DELETE / OPTIONS follow same structure with :method: PUT, :method: DELETE, etc.
🌐 HTTP/3 (QUIC)
HTTP/3 is almost identical to HTTP/2 in terms of request structure, but it runs over UDP using QUIC
instead of TCP.
🔷 GET (HTTP/3)
:method: GET
:scheme: https
:authority: www.example.com
:path: /api/products/123
accept: application/json
✅ Response:
:status: 200
content-type: application/json
{"id":123,"name":"Sample Item","price":25.50}
All methods (GET, POST, PUT, DELETE, OPTIONS) use the same pseudo-header format.
Headers are compressed using QPACK.
QUIC enables zero-round-trip (0-RTT), fast TLS 1.3, and better connection migration.
🔁 Summary Table
Feature HTTP/1.1 HTTP/2 HTTP/3