HTTP request headers and response headers include information What?

Each HTTP request and response are with corresponding header information. By default, while transmitting XHR request, following the header information is also sent:

Accept: Content browser can handle the type of
Accept-Charset: browser capable of displaying the character set
Accept-Encoding: compression-encoding the browser can handle
browser language currently set: the Accept-Language
Connection: the connection between the browser and the server type
Cookie: Cookie any of the current page settings
Host: requesting domain page where the
Referer: requesting the page the URL of
the user-agent: browser user agent string

Although header information is actually transmitted different browsers vary, but basically listed above are transmitted from the browser, with the setRequestHeader () method may also be provided information request header, the function accepts two parameters: a head value name field and the head of the field. To successfully send a request header information, to be called before and after calling the send method calls the open method.

HTTP response headers:

Date: indicates the time of message transmission, time description format defined by the rfc822
server: Server name.
Connection: the type of connection between the browser and the server
content-type: indicates that the following documents belong to what MIME type
Cache-Control: Control HTTP caching

Guess you like

Origin blog.csdn.net/weixin_33989780/article/details/90772628