HTTP
HTTP (HyperText Transfer Protocol) is the application-layer protocol that defines the rules for exchanging information between a client — usually a browser — and a web server. The entire World Wide Web rests on HTTP: when you enter a web address, the browser sends an HTTP request, and the server responds by returning the HTML, images, styles and other resources needed to display the site.
How HTTP works
Communication follows a request–response model. The client sends a request containing a method, a resource path and headers, and the server returns a response with a status code and content. The most important methods are:
- GET — retrieve a resource (for example, load a page).
- POST — submit data to the server (for example, send a form).
- PUT and DELETE — update and remove resources, used heavily in REST APIs.
Every response carries a status code: 200 means success, 301 a permanent redirect, 404 a missing resource, and 500 a server error. A key trait of the protocol is that it is stateless — the server does not remember previous requests by default, so session state is maintained with additional mechanisms such as cookies or tokens.
Practical application
HTTP is the basis of how websites, web applications and APIs operate. Knowing its methods and status codes is essential for troubleshooting — by reading server logs or the browser's developer tools, you can quickly tell from the response codes whether a problem lies with the client, a redirect or the server. Today traffic almost always moves to encrypted HTTPS and the newer protocol versions, HTTP/2 and HTTP/3, which speed up page loading.
Powiązane pojęcia
Najczęstsze pytania
What does it mean that HTTP is stateless?
Each HTTP request is independent — the server does not, by default, remember previous interactions with the same client. To preserve state, such as a logged-in session, mechanisms layered on top of the protocol are used, including cookies, sessions and tokens.
How does HTTP differ from HTTPS?
HTTPS is HTTP carried over an encrypted TLS layer. HTTP data travels in plain text and can be eavesdropped, whereas HTTPS encrypts it and verifies the server's identity with a certificate. Today HTTPS is the standard, and browsers flag plain HTTP as not secure.
