Happy New Year, friends. This is my second article of 2019 lol thanks for reading. In 2018, I shared a lot of knowledge about HTTP and HTTPS. Please check it out. If you like it, please like it and follow it.” Seamless placement of ads “😁. Ha ha nonsense do not say, read the article

Today I will share the entity first fields, before I share the request header fields – one of the four big first field the general first field – one of the four big first field in the response to the first field – one of the four big first field profile commonly used 47 first field, is for the introduction of the common 47 first field, this article to write the other four articles, Because we are all exquisite people, ha ha, “introduction commonly used 47 first field” is only about the meaning of 47 fields, no detailed explanation, feeling is in a perfunctory, then share the four first field. Let’s cut to the chase.

Entity header field can be imagined, is used to represent the entity content and requirements of the field, today let’s look at the commonly used 10, entity header field, 10!! 😨, the guy don’t be afraid, the commonly used request field is 19, ha ha 😁, in fact, everyone will remember after reading the basic. Take a look if you don’t believe me


1, Allow Giving; Approved “)

This field is used to tell the client which HTTP methods the server can accept, such as GET, POST, DELETE, OPTIONS, and PUT. If the client uses a Method that the server does Not support, the server will respond to 405 Method Not Allowed. At this point, the supported methods are placed as values after Allow to notify the client to use the supported methods.



2. Last-modified

If you look at this entity header field and you think if-modified-since and if-unmodified-since request header field, the smart guy feels like he knows something, The use of if-modified-since and last-modified is examined in relation to the 304 status code, a common interview question.

Each resource is created or Modified with a last-modified time value. When the client requests it, the header field returns the last-modified value, and the client saves the last-modified value. When the client requests again, When the server sees the if-modified-since request field, it compares it to the last-modified value of the server resource and returns a 304 buffer. If not, it will return the new resource 200 ok.



3. Expires (” Expires; Validity period “)

This field tells the client when the resource cache has expired last-modified: Wed, 23 May 2012 09:59:55 GMT, if you do not want to leave the Cache, set this value to the time when the data header field is created to be consistent. I will share the details of the “cache-control” field separately in the future



4, the content-type

This field is similar to the Accept field at the beginning of the request. Accept tells the server what media Type to Accept. Content-type tells the client what encoding to choose for the Content

5, the Content – Length

Tells the client the size of the entity’s content, in bytes

6, the Content – Range

This field is used only in response to a scope request to inform the client that the response entity does not meet the client’s requirements.



7, the Content Encoding

Tells the client what encoding format to choose for the entity content



8, the Content – the MD5

This field is very interesting. It is created to prevent the packet body from being tampered with. The value produced by the MD5 algorithm is used.

However, if the packet can be tampered with, the content-MD5 of the entity header can also be changed, so this field will be meaningless 😁, see the secure Communication Mechanism of HTTPS for request security.



9, the Content – Language

Informs the client of the natural language of the physical content selection



10, the Content – the Location

Informs the client that the entity content is coming with that resource server