HTTP authoritative Guide First chapter HTTP Overview

Source: Internet
Author: User

Introduction

??

This chapter is a summary of the book, the personal feeling or should be the first to clear each point of knowledge and then come back to see this chapter, so that each part has a clear understanding, and then the entire knowledge network to connect together, you can understand how the network is running

??

The book begins with an example, and, like other books, tells the process that occurs when a browser enters a URL.

??

Instance

??

When a browser browses a page as a Web client (such as http://www.oreilly.com/index.html), the browser client sends an HTTP request to the server www.oreilly.com. The server looks for the desired object (in this case,/index.html) and, if successful, sends the object, object type, object length, and other information to the client in the HTTP response.
?

??

Web Resources

??

The WEB server appends a MIME (Multipurpose Internet Mail Extension, Multipurpose Internet Mail Extension) type to all HTTP object Data . When a Web browser retrieves an object from the server, it looks at the relevant MIME type to see if it knows what to do with the object .

??

??

A MIME type is a text marker that represents a primary object type and a specific subtype , separated by a slash.

??

HTML-Formatted text documents are marked by the text/html type.

Ordinary ASCII text documents are marked by the Text/plain type.

Images in JPEG format are of type Image/jpeg.

The picture in GIF format is the image/gif type.

??

each WEB server resource has a name so that the client can explain what resources they are interested in .

??

The server resource name is called the Uniform Resource Identifier (Uniform Resource Identifier,uri). Http://www.oreilly.com/index.html is a URI that represents a static page resource

??

Shows how the URI instructs the HTTP protocol to access the picture resource on the Joe store server. Given the uri,http, you can parse the object.

??

??

There are two forms of URIs, called URLs and urns, respectively. Now let's look at these resource identifier types separately.

??

Url

??

The Uniform Resource Locator (URL) consists of three parts.

??

The first part of the URL is called Scheme, which describes the type of protocol used to access the resource . This section is usually the HTTP protocol (//).

The second part gives the server's Internet address (for example, www.joes-hardware.com).

The remainder specifies a resource on the WEB server (for example,/specials/saw-blade.gif)

??

The second form of a URI is a Uniform Resource name (URN). A urn is used as a unique name for a specific content, regardless of where the current resource is located . With these location-independent urns, you can move resources around

??

Transaction

??

An HTTP transaction consists of a request command and a response result .

??

This communication is done through a formatted block of data called an HTTP message .

??

??

When an application finishes a task, it typically publishes multiple HTTP transactions . For example, a Web browser publishes a series of HTTP transactions to get and display a Web page with a rich picture. The browser executes a transaction to get the HTML "frame" that describes the layout of the page, and then publishes additional HTTP transactions to get each embedded picture, image panel, Java applet, and so on. These embedded resources may even reside on different servers. Therefore, a "Web page" is usually not a single resource, but rather a collection of a set of resources.

??

Message

??

The HTTP message sent from the Web client to the Web server is called the request message. Messages sent from the server to the client are called Response Messages (response message)

??

??

The HTTP message consists of the following three parts.

?

1. Starting Line

??

The first line of the message is the starting line, which is used in the request message to indicate what is to be done, and what happens in the response message .

??

2. Header field

??

The starting line is followed by 0 or more header fields. Each header field contains a first name and a value , separated by a colon (:) for ease of resolution. the header ends with a blank line . Adding a header field is as simple as adding a new line.

??

3. Main body

??

The empty line is followed by an optional message body, which contains all types of data. The request body includes data to be sent to the WEB server, and data to be returned to the client is loaded in the response body .

??

The starting line and header are both textual and structured, and the subject is different, and the body can contain arbitrary binary data (slices, video, audio tracks, software programs). Of course, the body can also contain text

??

??

Connection

??

How the message is moved from one place to another via the transmission Control Protocol (transmission-PROTOCOL,TCP) connection.

??

HTTP is an application-layer protocol. HTTP does not need to worry about the specifics of network communication, it gives the details of networking to the universal, reliable Internet Protocol TCP/IP.

??

TCP provides the following:

?

Error-free data transmission;

Sequential transmission (data will always arrive in the order sent);

Data streams that are not fragmented (data can be sent at any time and at any size).

??

The HTTP protocol is located on top of TCP. HTTP uses TCP to transmit its message data. Similarly, TCP is located on the upper level of the IP

??

??

Before an HTTP client sends a message to the server, it needs to establish a TCP/IP connection between the client and the server with an Internet Protocol (PROTOCOL,IP) address and port number.

??

The process of establishing a TCP connection is similar to calling someone at a company office. First, you call the company's phone number. This will get you into the right organization. Second, dial the extension number of the person you want to contact.

??

??

Agent

??

Web caching (Web cache) or proxy cache is a special HTTP proxy server that can copy and save frequently used documents that have been transferred by proxy. The next client requesting the same document will be able to enjoy the services provided by the cached private copy.

??

Save a local copy of a common document to improve the performance of the proxy cache

??

It is much faster for clients to download documents from nearby caches than from remote Web servers. HTTP defines a number of features that make caching more efficient and regulate the freshness of documents and the privacy of cached content. The 7th chapter introduces the caching technology.

??

Gateway

??

A gateway is a special kind of server that is used as an intermediary entity for other servers. Typically used to convert HTTP traffic to other protocols. The gateway accepts the request as if it were the source-side server for the resource. The client may not know that it is communicating with a gateway.

??

For example, an HTTP/FTP gateway receives a request for an FTP URI over an HTTP request, but obtains the document via the FTP protocol (see figure 1-13). The resulting document is encapsulated in an HTTP message and sent to the client.

??

Tunnel

??

The Tunnel (tunnel) is an HTTP application that is built up to blind forward the original data between the two connections. HTTP tunneling is typically used to forward non-HTTP data on one or more HTTP connections and does not spy on the data when it is forwarded.

??

a common use of HTTP tunneling is to host encrypted Secure Sockets Layer (SSL, secure Sockets layer) traffic over an HTTP connection so that SSL traffic passes through firewalls that allow only WEB traffic . As shown in 1-14, the Http/ssl tunnel receives an HTTP request to establish an output connection to the destination address and port, and then transmits the encrypted SSL traffic over the HTTP channel through the tunnel, so that it can be blindly forwarded to the destination server.

??

??

Agent agents

??

The user Agent agent (or simply Agent agent) is the client program that initiates the HTTP request on behalf of the user. All applications that publish WEB requests are HTTP agent agents. So far , we've only mentioned one HTTP agent proxy: A Web browser , but there are many other types of user agent agents.

??

For example, some auto-user agent agents that roam on the Web can publish HTTP transactions and get content without being monitored. The names of these automatic proxies are often vivid, such as "Spider-Spiders" or "Web-bot" ( Web robots) (see Figure 1-15). Spiders roam the Web, gathering information to build effective Web content files, such as a search engine's

Database or Product catalog generated for the comparison shopping robot

??

? ?

HTTP authoritative Guide First chapter HTTP Overview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.