ENES

HTTP

The request-and-response language browsers and websites speak.

A browser sending a GET request to a server and receiving a 200 OK response, with the status codes 200, 404 and 500 below

HTTP (HyperText Transfer Protocol) is the set of rules a browser and a web server use to talk. The browser sends a request (give me this page) and the server sends back a response (the page, or an error). Every web page, image and API call you use runs on this simple back-and-forth.

A request has a method and a path. GET /menu means fetch the menu; POST /order means here is some data, create an order. The response starts with a status code: 200 is OK, 404 is not found, 500 is the server broke. Both carry headers, small notes such as the type of content, the language, or a cookie that identifies you.

HTTP is stateless: each request stands alone, and the server does not remember the previous one, which is why cookies and sessions exist. Plain HTTP is readable by anyone in between, so today almost everything uses HTTPS, which is the same conversation inside an encrypted tunnel. Newer versions (HTTP/2 and HTTP/3) make the exchange faster without changing what you ask for.

Keep in mind

Go deeper

Related terms

More in Networks