In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "how to understand HTTP header information". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
HTTP header explanation
1. Accept: tells the WEB server what media type it accepts, * / * represents any type, and type/* represents all subtypes under that type, type/sub-type.
2. Accept-Charset: the browser declares the character set it receives
Accept-Encoding: the browser declares the encoding method it receives. It usually specifies the compression method, whether it supports compression, and what compression method (gzip,deflate) it supports.
Accept-Language:: browsers declare the difference between the language they receive and the character set: Chinese is the language, and there are multiple character sets in Chinese, such as big5,gb2312,gbk and so on.
3. The Accept-Ranges:WEB server indicates whether it accepts requests to get part of one of its entities, such as part of a file. Bytes: accept, none: do not accept.
4. Age: when the proxy server responds to a request with its own cached entity, use this header to indicate how long it has been since the entity was created.
5. Authorization: when the client receives a WWW-Authenticate response from the WEB server, the header responds to its own authentication information to the WEB server.
6. Cache-Control: request: no-cache (entities that do not cache are required to be fetched from the WEB server now)
Max-age: (only objects with Age values less than max-age values and no expired objects are accepted)
Max-stale: (past objects can be accepted, but the expiration time must be less than
Max-stale value)
Min-fresh: (accept that its fresh life is greater than the sum of its current Age and min-fresh values
Cache object)
Response: public (you can respond to any user with Cached content)
Private (can only respond to the user who previously requested the content with cached content)
No-cache (can be cached, but can only be returned to the client after verifying its validity with the WEB server)
Max-age: (expiration time of the objects included in this response)
ALL: no-store (caching is not allowed)
7. Connection: request: close (tell the WEB server or proxy server to complete the response to this request
After, disconnect, do not wait for the subsequent request of this connection).
Keepalive (tells the WEB server or proxy server that after completing this request
After responding, keep the connection and wait for the subsequent request for this connection).
Response: close (connection has been closed).
Keepalive (the connection is maintained, waiting for subsequent requests for this connection).
Keep-Alive: if the browser requests to keep the connection, this header indicates that you want the WEB server to keep it.
How long to connect (in seconds).
For example: Keep-Alive:300
8. The Content-Encoding:WEB server indicates what compression method (gzip,deflate) it uses to compress the objects in the response.
For example: Content-Encoding:gzip
The Content-Language:WEB server tells the browser the language of the object it is responding to.
Content-Length: the WEB server tells the browser the length of the object it responds to.
For example: Content-Length: 26012
Content-Range: the WEB server indicates which part of the whole object the response contains.
For example: Content-Range: bytes 21010-47021: 47022
Content-Type: the WEB server tells the browser the type of object it responds to.
For example: Content-Type:application/xml
9. ETag: is the flag value of an object (such as URL), as far as an object is concerned, such as an html file
If it is modified, its Etag will not be modified, so the function of ETag is the same as that of Last-Modified.
The function is similar, mainly for the WEB server to determine whether an object has changed.
For example, the last time you requested a html file, you got its ETag, and when you requested the file this time,
The browser will send the previously obtained ETag value to the WEB server, and then the WEB server
Will compare this ETag with the current ETag of the file, and then you will know the file
Has it changed.
10. The Expired:WEB server indicates when the entity will expire, and for expired objects, only if the
After verifying its validity with the WEB server, it can be used to respond to customer requests.
It's HTTP/1.0 's head.
For example: Expires:Sat, 23 May 2009 10:02:12 GMT
11. Host: the client specifies the domain name / IP address and port number of the WEB server it wants to access.
For example: Host:rss.sina.com.cn
12. If-Match: if the ETag of the object has not changed, it means that the object has not changed before the requested action is performed.
If-None-Match: if the ETag of the object has changed, it means that the object has also changed before the requested action is performed.
13. If-Modified-Since: if the requested object is modified after the time specified in the header, the request is executed
(such as returning an object), otherwise return code 304, telling the browser that the object
There are no changes.
For example: If-Modified-Since:Thu, 10 Apr 2008 09:14:42 GMT
If-Unmodified-Since: executes only if the requested object has not been modified after the time specified in the header
The requested action (such as a return object).
14. If-Range: the browser tells the WEB server that if the object I request does not change, it will take what I am missing
Give it to me. If the object changes, give me the whole object. The browser sends the request object's
ETag or the last modification time that you know is given to the WEB server to determine whether the object is
It's changed.
Always used with Range headers.
15. The Last-Modified:WEB server believes that the last modification time of the object, such as the last modification time of the file
The last generation time of the dynamic page, and so on.
For example: Last-Modified:Tue, 06 May 2008 02:42:43 GMT
16. The Location:WEB server tells the browser that the object you are trying to access has been moved to another location
Pick it up at the specified position of the head.
For example: Location:
Https://cache.yisu.com/upload/information/20210311/298/7193.gif
17. Pramga: mainly uses Pramga: no-cache, which is equivalent to Cache-Control: no-cache.
For example: Pragma:no-cache
18. Proxy-Authenticate: the proxy server responds to the browser and asks for proxy authentication information.
Proxy-Authorization: the browser responds to the authentication request of the proxy server and provides its own identity information.
19. Range: browsers (such as Flashget multithreaded downloads) tell the WEB server which part of the object it wants to fetch.
For example: Range: bytes=1173546-
20. Referer: the browser indicates to the WEB server which web page / URL it obtained / clicked on the URL / URL in the current request.
For example: Referer: http://www.sina.com/
21. Server: the WEB server indicates what kind of software and version it is.
For example: Server:Apache/2.0.61 (Unix)
twenty-two。 User-Agent: the browser identifies itself (what kind of browser it is).
For example: User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN)
Rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
23. Transfer-Encoding: the WEB server indicates that it is responding to this response message body (not an object in the message body)
What kind of coding has been made, such as whether to chunked or not.
For example: Transfer-Encoding: chunked
24. Vary: the WEB server uses the contents of this header to tell the Cache server under what conditions this response can be used.
The returned object responds to subsequent requests.
If the source WEB server receives the first request message, the header of its response message is:
Content-Encoding: gzip; Vary: Content-Encoding then the Cache server will analyze the follow-up
The header of the request message, check whether its Accept-Encoding is the same as the Vary header value of the previous response
Consistent, that is, whether to use the same content encoding method, which prevents the Cache server from using its own
The compressed entity response in Cache is sent to browsers that do not have the ability to decompress.
For example: Vary:Accept-Encoding
25. Via: lists which proxy servers go through responses from the client to the OCS or in the opposite direction, using the
What protocol (and version) sent the request.
When the client request arrives at the first proxy server, the server will be in its own request
Add the Via header and fill in your own relevant information, when the next proxy server receives the first proxy
When a request is made by the server, the Via of the request from the previous proxy server is copied in the request made by itself.
Header and add its own relevant information to the back, and so on, when OCS receives the last agent service
When a request is made by the server, check the Via header to know the route through which the request is routed.
For example: Via:1.0 236-81.D07071953.sina.com.cn:80 (squid/2.6.STABLE13)
= =
HTTP request message header example:
Host:rss.sina.com.cn
User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept:text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language:zh-cn,zh;q=0.5
Accept-Encoding:gzip,deflate
Accept-Charset:gb2312,utf-8;q=0.7,*;q=0.7
Keep-Alive:300
Connection:keep-alive
Cookie:userId=C5bYpXrimdmsiQmsBPnE1Vn8ZQmdWSm3WRlEB3vRwTnRtW
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.