web analytics

Transferring Files with HTTP

After a web client (browser) has created a TCP connection to a web server, the client can
begin requesting the web page from the server. Most often, the protocol used to transfer
the web page is HTTP. The HTTP application layer protocol, defined in RFC 7230, defines
how files can be transferred between two computers. HTTP was specifically created for the
purpose of transferring files between web servers and web clients.

HTTP defines several commands and responses, with the most frequently used being the
HTTP GET request . To get a file from a web server, the client sends an HTTP GET request
to the server, listing the filename. If the server decides to send the file, the server sends an
HTTP GET response, with a return code of 200 (meaning OK), along with the file’s contents.

NOTE Many return codes exist for HTTP requests. For example, when the server does not
have the requested file, it issues a return code of 404, which means “file not found.” Most
web browsers do not show the specific numeric HTTP return codes, instead displaying a
response such as “page not found” in reaction to receiving a return code of 404.

Web pages typically consist of multiple files, called objects. Most web pages contain text as
well as several graphical images, animated advertisements, and possibly voice or video. Each
of these components is stored as a different object (file) on the web server. To get them all,
the web browser gets the first file. This file can (and typically does) include references to
other URIs, so the browser then also requests the other objects. Figure 5-13 shows the general
idea, with the browser getting the first file and then two others.
Free CISCO CCNA Routing and Switching ICND1 Study Guide
Figure 5-13 Multiple HTTP Get Requests/Responses

In this case, after the web browser gets the first file—the one called “/go/ccna” in the
URI—the browser reads and interprets that file. Besides containing parts of the web page,
the file refers to two other files, so the browser issues two additional HTTP get requests.
Note that, even though it isn’t shown in the figure, all these commands flow over one (or possibly more) TCP connection between the client and the server. This means that TCP
would provide error recovery, ensuring that the data was delivered.

Subscribe To Get

Latest IT certification News 

Help You Pass Any IT Exam