HTTP request headers (response headers), HTTP2, HTTPS

Source: Internet
Author: User

Each HTTP request and response will have the appropriate header information. By default, the following header information is sent while the XHR request is sent:

Accept: Types of content that browsers can handle
Accept-charset: The character set that the browser can display
Accept-encoding: The compression code that the browser can handle
Accept-language: The language currently set by the browser
Connection: Type of connection between browser and server
Cookie: Any cookie for current page settings
Host: The domain in which the requested page is issued
Referer: URL of the page that issued the request
User-agent: User agent string for browser

Although different browsers actually send the header information differently, but the above list is basically the browser will send, with the setRequestHeader () method can also set the request header information, the function accepts two parameters: Header field name and header field value. To successfully send the request header information, it needs to be called before the Open method is called and before the Send method is called.

HTTP Response header information:

Date: Indicates when the message was sent, and the description format of the time is defined by rfc822
Server: Names of servers.
Connection: Type of connection between browser and server
Content-type: Indicates what MIME type the following document belongs to
Cache-control: Controlling HTTP Caching

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.