How does HTTP work?
RFC 9110, the IETF standard that defines HTTP semantics, describes it as a stateless application-level protocol for distributed, collaborative, hypertext information systems [1]. MDN calls it the foundation of any data exchange on the web: a client-server protocol in which the client, usually the browser, always initiates the request [2].
Clients and servers exchange individual messages rather than a stream of data. What the client sends are requests, and what the server sends back are responses [2]. In MDN's example, the browser sends the request below and the server replies with a response that starts with "HTTP/1.1 200 OK" and carries the HTML page [2]:
GET / HTTP/1.1
Host: developer.mozilla.org
Accept-Language: frThe GET method requests transfer of a current representation of the target resource and is one of the safe, essentially read-only methods. A POST body, by contrast, is information for the target resource to process [1].
What does stateless mean?
There is no link at the protocol level between two requests made one after another on the same connection [2]. Sites that keep you logged in get around this with cookies: the core of HTTP stays stateless, but cookies make stateful sessions possible [2].
How is HTTP different from HTTPS?
HTTPS is the encrypted version of HTTP, using TLS to encrypt all communication between client and server [3]. Under RFC 9110, a client must make sure the connection is secured before sending a request for an "https" resource, and the default port is 443 [1].