HTTP/HTTPS

Definition

HTTP (Hypertext Transfer Protocol) is the foundation protocol of the World Wide Web, defining how messages are formatted and transmitted over the internet. HTTPS is HTTP over TLS, adding encryption and authentication.

HTTP is a request-response protocol: clients send requests, servers return responses. It is stateless by design (each request is independent).

HTTP Methods

Method Purpose Idempotent Safe
GET Retrieve resource Yes Yes
POST Create resource No No
PUT Replace resource Yes No
PATCH Partial update No No
DELETE Delete resource Yes No
HEAD Get headers only Yes Yes
OPTIONS Supported methods Yes Yes

HTTP Versions

Version Year Key Features
HTTP/1.0 1996 Basic request-response
HTTP/1.1 1997 Persistent connections, pipelining, chunked encoding
HTTP/2 2015 Multiplexing, header compression (HPACK), binary framing
HTTP/3 2022 QUIC protocol (UDP), 0-RTT, improved congestion control

HTTP Status Codes

Category Codes Meaning
1xx 100-199 Informational
2xx 200-299 Success (200 OK, 201 Created)
3xx 300-399 Redirection (301 Moved, 302 Found, 304 Not Modified)
4xx 400-499 Client error (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found)
5xx 500-599 Server error (500 Internal, 502 Bad Gateway, 503 Service Unavailable)

HTTP vs HTTPS

Feature HTTP HTTPS
Port 80 443
Encryption None TLS encrypted
Authentication None Certificate-based
Performance Slightly faster TLS handshake overhead
SEO Lower ranking Google ranking boost
Adoption Deprecated Universal standard