Context request and response

HTTP requests and responses are commonly represented the head of some contexts, the context is the so-called request came from, or in response to the request and subsequent requests in response to which impact.

Context of the request: User-Agent

Specify the type of client information, the server could then make decisions on resource representation

User-Agent = product *( RWS ( product / comment ))

  • product = token [ "/" product-version ]
  • RWS = 1*( SP / HTAB)

For example: there is supporting information for Mozilla, the client computer system version, browser rendering engine information, browser version, etc.

User-Agent:  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Context of the request: Referer
The browser will automatically add a request from the head of a page, if the non-browser may not add head. For example, in adding my blog link, click on this link to grab the request packet will be Referer.
  • Referer = absolute URI / partial-URI
      • For example: Referer: https://www.cnblogs.com/
Referer scene will not be added
  • Sources page protocol used is a local file "file" or "data" URI
  • When the current page request http protocol used, and the source of the page using the https protocol

Statistical analysis commonly used in server-side cache analysis, security chain and other functions

Context of the request: From

  • The main person responsible for the Web crawler, crawlers to tell the server how to contact through the mail
  • From = mailbox

Context response: Server

  • Specify the server software information used to help clients locate problems or statistics
  • Server = product *( product / comment )
  • product = token [ "/" product-version ]

E.g:

  • Server: nginx
  • Server: openresty/ 1.13.6.2

Context response: Allow the Accept-Ranges

Allow: tell the client, the client tells the server resource corresponding to the URI method of execution which allows

  • Allow = #method
  • 例如:Allow: GET,HEAD,PUT 

Accept-Ranges: tell the customer resources on the server end whether to allow range requests

  • Accept-Ranges = acceptable-ranges
  • E.g:
      • Accept-Ranges:bytes     
      • Accept-Ranges:none

Guess you like

Origin www.cnblogs.com/fengxiaoyuan/p/10964086.html