HTTP header information

The HTTP protocol defines many methods for interacting with the server. There are four basic ones, namely: POST (add), GET (check), PUT (change), and DELETE (delete).

HTTP header information includes four parts: general header, request header, response header and entity header. Each header field consists of a domain name, a colon and a field value.

1. General header: It is a header that can be used by both the client and the server. The general header field includes Cache-Control, Connection, Date, Pragma, Transfer-Encoding, Upgrade, and Via.

2. Request headers: They are unique to the request message. They provide the server with some additional information, such as what type of data the client wants to receive, such as the Accept header.

3. Response header: It is convenient for the client to provide information, such as which type of server the client is interacting with, such as the Server header.

4. Entity header: The header used to deal with the main body of the entity. For example, the data type of the main body of the entity can be described in the entity header, such as the Content-type header.

 

Here are some common request headers:

Accept: Tell the WEB server what media type it accepts.

Accept-Ecoding: The browser declares the encoding method it accepts.

Connection: Request: (1) close (tell the server to disconnect after completing the response to this request and not to wait for subsequent requests for this connection)

          (2) keepalive (after completing this request, keep the connection and wait for subsequent requests of this connection)

Content-Type: The server tells the browser the object type of its response.

Content-Length: The server tells the browser the length of the object in its response.

Server: The server indicates what software and version information it is.

 

*2, the meaning of HTTP request headers and response headers

Request header:

Accept: text/html, image/* (types that browsers can accept)

Accept-Charset: ISO-8859-1 (the type of encoding that the browser can accept)

Accept-Encoding: gzip, compress (the browser can accept the compression encoding type)

Accept-Language: en-us,zh-cn (language and country types that browsers can accept)

Host: www.it315.org:80 (the host and port requested by the browser)

If-Modified-Since: Tue, 11 Jul 2000 18:23:51 GMT (a page cache time)

Referer: http://www.it315.org/index.jsp (which page the request came from)

User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) (browser related information)

Cookie: (the browser temporarily stores the information sent by the server)

Connection: close(1.0)/Keep-Alive(1.1) (feature of HTTP request version)

Date: Tue, 11 Jul 2000 18:23:51 GMT (time of requesting website)

 

Response header:

Location: http://www.it315.org/index.jsp (control which page the browser displays)

Server: apache tomcat (type of server)

Content-Encoding: gzip (compression encoding method sent by the server)

Content-Length: 80 (the length of the bytecode sent by the server for display)

Content-Language: zh-cn (the language and country name of the content sent by the server)

Content-Type: image/jpeg; charset=UTF-8 (the type and encoding type of the content sent by the server)

Last-Modified: Tue, 11 Jul 2000 18:23:51 GMT (the time the server was last modified)

Refresh: 1;url=http://www.it315.org (control the browser to forward the page pointed to by the URL after 1 second)

Content-Disposition: attachment; filename=aaa.jpg (The server controls the browser to send the download method to open the file)

Transfer-Encoding: chunked (the server transfers data to the client in chunks) 

Set-Cookie:SS=Q0=5Lb_nQ; path=/search(The server sends Cookie related information)

Expires: -1 (the server controls the browser not to cache web pages, the default is to cache)

Cache-Control: no-cache (the server controls the browser not to cache web pages)

Pragma: no-cache (the server controls the browser not to cache web pages)  

Connection: close/Keep-Alive (features of the HTTP request version)  

Date: Tue, 11 Jul 2000 18:23:51 GMT (response site time)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324932421&siteId=291194637