Web browsers, servers, and related Web applications all communicate with each other through HTTP. HTTP is the common language used in modern global Internet.
1.1http– Multimedia Messenger of the Internet
HTTP uses a reliable data transfer protocol to ensure that data is not corrupted or chaotic during transmission.
1.2 Web client and server
Web content is stored on a Web server, and the Web server uses the HTTP protocol, which is often referred to as an HTTP server. The HTTP client and HTTP server work together to project the basic components of the World Wide Web.
1.3 Resources
Web servers are hosts of Web resources (Web Resource), and web crews are the source of Web content. Resources are divided into: static files in the Web server file system, software programs that generate content as needed.
1.3.1 Media Type
HTTP uses a data format label called MIME for each object to be transmitted over the Web. (Multipurpose Internet Mail Extension, Multipurpose Internet Mail Extension) to describe and tag multimedia content.
The Web server appends a MIME type to all HTTP object data.
A MIME type is a text marker that represents a primary object type and a specific subtype, separated by a slash.
1.3.2 URI
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). URIs, like postal addresses on the Internet, uniquely identify and locate information resources around the world.
There are two forms of URIs, url and urn, respectively.
1.3.3 URL
The Uniform Resource Locator (URL) is the most common form of resource identifiers. The URL describes a specific location for a resource on a specific server.
Most URLs follow a standard format, which consists of three parts:
- The first part of the URL is called scheme, which describes the type of protocol used to access the resource, usually the HTTP protocol
- The second part gives the server's Internet address.
- The rest of the section formulates a resource on the Web server.
Now almost all URIs are URLs.
1.3.4 URN
A Uniform Resource name (URN), which is used as a unique name for a specific content, regardless of the location of the current resource. With these location-independent urns, you can move resources around, use urns, and use the same name to access resources through a variety of network access protocols.
1.4 Business
An HTTP transaction consists of a request command and a response result, which is done through a formatted block of data called HTTP insulation (HTTP message).
1.4.1 Method
HTTP supports several different request commands, which are called HTTP methods (HTTP method). This method tells the server what action to perform.
1. GET send a named resource from the server to the client
2. Put stores data from the client to a named server resource
3. Delete the named resource from the server
4. Post sends client data to a server gateway application
5. HEAD only sends the HTTP header in the named resource corresponding
1.4.2 Status Code
Each HTTP corresponding message return will carry a status code. A status code is a three-digit code that tells the client whether the request is successful or if it needs to take other actions. HTTP also sends an explanatory ' cause phrase ' text along with each number status code.
1.4.3 can contain multiple objects in a Web page
An application completes a task that typically publishes multiple HTTP transactions.
1.5 Messages
An HTTP message is made up of simple strings of one line, plain text.
The HTTP message sent from the Web client to the Web server becomes the request message, and the message sent from the server to the client becomes the response message (response message), with no other type of message.
- 1. start 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 is happening in the corresponding message
- 2. Header Field
The starting line is followed by 0 or more header fields. None of the header fields contain a name and a value, which is easy to parse, separated by a colon (:).
- 3. main body
The empty line is followed by an optional message body that contains all types of data. The request body includes the data to be sent to the Web server, and the response body loads the data to be returned to the client.
1.6 Links
How the message is moved from one place to another through a transmission Control protocol (transmission-Protocol, TCP) connection.
1.6.1 TCP/IP
HTTP is an application-layer protocol. HTTP does not need to worry about the specifics of network communication, he put the details of the Internet into a universal, reliable Internet Protocol TCP/IP.
TCP provides the following:
- Error-Free data transfer
- sequentially transmitted
- Non-fragmented data flow
The internet itself is based on TCP/IP, so long as the TCP link is established, the message between the client and server will not be lost or destroyed. In terms of network terminology, the HTP protocol is located on the upper layer of TCP and TCP is located on the upper layer of IP.
1.6.2
Before an HTTP client sends a message to the server, it needs to establish a TCP/IP link between the client and the server with an Internet Protocol (PROTOCOL,IP) address and port number.
In TCP, you need to know the IP address of the server and the TCP port number associated with the specific software running on the server.
The domain name in the text form is called the host name. Hostname is the name of a wayward IP address, you can easily convert the host name to an IP address through a mechanism called Domain Name Service, DNS.
1.7 Protocol version
1.http/0.9
2.http/1.0
3.http/1.0+
4.http/1.1
1.8 Structure components of the web
Web applications (Web browsers and Web servers), some other more important applications
Agent
An HTTP intermediate entity located between the client and the server
Cache
The HTTP repository is a copy of the frequently used pages that can be saved closer to the client.
Gateway
Special Web server to connect to other applications
Tunnels
Special processing for blind forwarding of HTTP communication messages
Agent Agent
Semi-intelligent Web client that initiates an automatic HTTP request
1.8.1 Agent
An important component of HTTP proxy server, Web security, application integration, and performance optimization.
The agent sits between the client and the server, receives HTTP requests from all clients, and forwards those requests to the server. For security reasons, the agent is typically used as a trusted intermediary node for forwarding all web traffic. The agent can also filter the request and the corresponding.
1.8.2 Cache
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. 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 and privacy of cached content.
1.8.3 Gateway
A gateway is a special server that is used as an intermediary entity for other servers. Typically used to convert HTTP traffic to other protocols. The gateway receives the request as if it were the source-side server for the resource. The client may not know that he is accessing a gateway for communication.
1.8.4 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 links, and forwarding is not prying into data.
1.8.5 Agent
The user Agent agent is a client program that represents a user-initiated HTTP request. All applications that publish Web requests are HTTP agent agents. So far, we've talked about a httpagent proxy: Web browsing.
1.9 Concluding remarks of the starting part
How HTTP uses URIs to name multimedia resources on a remote server.
1.10 More information
HTTP Learning 1-1 chapter1-http overview