Communicating through HTTP

Second, a web server provides support for HTTP (Hypertext Transfer Protocol). As its name implies, HTTP specifies how to transfer hypertext (linked web documents) between two computers.

A Protocol is a set of rules for communication between two computers. HTTP is a textual, stateless protocol.

All commands are plain-text and human-readable.

Neither the server nor the client remember previous communications. For example, relying on HTTP alone, a server can’t remember a password you typed or remember your progress on an incomplete transaction. You need an application server for tasks like that. (We’ll cover that sort of technology in other articles.)

HTTP provides clear rules for how a client and server communicate. We’ll cover HTTP itself in a technical article later. For now, just be aware of these things:

Usually only clients make HTTP requests, and only to servers. Servers respond to a client’s HTTP request. A server can also populate data into a client cache, in advance of it being requested, through a mechanism called a server push.
When requesting a file via HTTP, clients must provide the file’s URL.
The web server must answer every HTTP request, at least with an error message.
On a web server, the HTTP server is responsible for processing and answering incoming requests.

Upon receiving a request, an HTTP server first checks if the requested URL matches an existing file.
If so, the web server sends the file content back to the browser. If not, an application server builds the necessary file.
If neither process is possible, the web server returns an error message to the browser, most commonly 404 Not Found. The 404 error is so common that some web designers devote