HTTP reference
HTTP - Hypertext Transfer Protocol - is the foundation of data communication on the World Wide Web. It's an application layer protocol that standardizes how clients (such as web browsers) and servers communicate. HTTP follows a request-response model where clients send requests to servers, and servers respond with the requested resources or appropriate status messages.
First developed by Tim Berners-Lee at CERN in 1989, HTTP has evolved through several versions:
- HTTP/1.0 (1996):
Introduced basic functionality but created a new connection for each request/response pair - HTTP/1.1 (1997):
Added persistent connections, chunked transfers, and other improvements - HTTP/2 (2015):
Introduced multiplexing, server push, header compression, and binary protocol format - HTTP/3 (2022):
Implemented over QUIC, a UDP-based protocol, improving performance and reliability
HTTP is stateless by design, meaning each request from a client to a server is independent and contains all the information needed to understand and process it. This design choice makes HTTP simple, scalable, and resilient.
Key Components of HTTP
HTTP communication consists of several key components:
HTTP Messages
HTTP messages are the units of communication between clients and servers:
- Requests: Sent by clients to servers, containing a method (like GET or POST), a URL, headers, and sometimes a body
- Responses: Sent by servers to clients, containing a status code, headers, and often a body with the requested resource
HTTP Headers
HTTP headers provide additional information about the request or response. They control caching, authentication, content negotiation, and many other aspects of HTTP communication. Headers are key-value pairs sent in both requests and responses.
HTTP Status Codes
HTTP status codes are three-digit numbers returned by a server in response to a client's request. They indicate whether a specific HTTP request has been successfully completed or what kind of error occurred. Status codes are grouped into five categories:
- 1xx (Informational):
The request was received, continuing process - 2xx (Success):
The request was successfully received, understood, and accepted - 3xx (Redirection):
Further action needs to be taken to complete the request - 4xx (Client Error):
The request contains bad syntax or cannot be fulfilled - 5xx (Server Error):
The server failed to fulfill a valid request
Explore HTTP
This reference documentation provides detailed information about HTTP components. Use the navigation to explore:
- HTTP Status Codes - Comprehensive guide to all HTTP status codes
- HTTP Request Headers - Detailed information about HTTP request headers