


We use cookies to improve your experience
We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience.
Definition
HTTP (Hypertext Transfer Protocol) is the foundation protocol of the World Wide Web. It defines how messages are formatted and transmitted between web browsers and servers, using a request-response model where clients send requests and servers return responses.
Every web page load starts with an HTTP request. The browser sends a request line (method + URL + version), headers (metadata like User-Agent, Accept, cookies), and optionally a body (for POST/PUT requests). The server processes the request and returns a status line (like "200 OK" or "404 Not Found"), response headers (content type, caching directives, cookies), and a body (the HTML, JSON, image, or other content).
GET retrieves data without side effects — it is safe and idempotent. POST submits data to create a resource. PUT replaces an existing resource entirely. PATCH partially updates a resource. DELETE removes a resource. HEAD is like GET but returns only headers (useful for checking if a resource exists). OPTIONS describes which methods an endpoint supports, used in CORS preflight requests.
HTTP/1.1 (1997) added persistent connections and chunked transfer encoding. HTTP/2 (2015) introduced multiplexing (multiple requests over a single connection), header compression, and server push. HTTP/3 (2022) replaces TCP with QUIC (based on UDP), eliminating head-of-line blocking and reducing connection setup time. Modern browsers and servers support all three versions, negotiating the best one automatically.