For the Internet, the concept of LAN is developed. As the network grows, more regulations are required on the protocol. We have learned a lot about HTTP. Now let's talk about the knowledge of HTTP entity. What are the actual facts? Let's take a look at the following article. First, let's talk about how HTTP works.
HTTP protocol Operation Mode
HTTP is based on the request/response paradigm. After a client establishes a connection with the server, it sends a request to the server in the format of Uniform Resource Identifier and Protocol version number, the MIME information is followed by the request modifier, client information, and possible content. After receiving the request, the server sends a response in the format of a Protocol version number containing the information, a successful or wrong code in the status line, MIME information is followed by server information, entity information, and possible content. Many HTTP communications are initiated by a user proxy and include a request to request resources on the source server. The simplest case may be that a separate connection is established between the user proxy (UA) and the source server (O.
When one or more intermediaries appear in the request/response chain, the situation becomes more complex. There are three types of mediation: Proxy, Gateway, and Tunnel ). A proxy accepts the request according to the absolute format of the URI, overrides all or part of the message, and sends the formatted request to the server through the URI identifier. The gateway is a receiving proxy and serves as the upper layer of some other servers. If necessary, you can translate the request to the lower layer server protocol. A channel serves as a relay point between two connections that do not change messages. The channel is often used when communication requires an intermediary (such as a firewall) or an intermediary that cannot identify messages.
HTTP entity
Request messages and response messages can both contain entity information. entity information is generally composed of entity header fields and entities. The object header contains the original information about the object, object headers include Allow, Content-Base, Content-Encoding, Content-Language, Content-Length, Content-Location, Content-MD5, Content-Range, Content-Type, Etag, Expires, Last -Modified and extension-header. Extension-header allows the client to define new object headers, but these fields may not be recognized by the recipient. An object can be an encoded byte stream. Its Encoding method is defined by Content-Encoding or Content-Type. Its Length is defined by Content-Length or Content-Range.
HTTP object -- Content-Type object header
The Content-Type object header is used to indicate the media Type of the object to the receiver. It specifies the object media Type that the HEAD method sends to the receiver, or the Content-Range object header of the request media type sent by the GET method is used to specify the insertion position of a part of the entire object. It also indicates the length of the entire object. When the server returns a partial response to the customer, it must describe the response coverage and the length of the entire object.
The general format is Content-Range: bytes-unitSPfirst-byte-pos-last-byte-pos/entity-le. For example, the format of the first 500 bytes field is Content-Range: bytes0-499/1234 if an http message contains this section, for example, a response to a Range request or an overlapping request to a Range), Content-Range represents the Range of the transfer, content-Length indicates the number of bytes actually transferred.
HTTP entity-Last-modified entity Header
The Last-modified object header specifies the Last revision time of the content saved on the server. For example, transfer the form of the header 500 byte field: Content-Range: bytes0-499/1234 if an http message contains this section for example, content-Range indicates the transfer Range, and Content-Length indicates the number of bytes actually transmitted.