Content negotiation of HTTP messages within HTTP messages returns the most appropriate content

Source: Internet
Author: User

There may be multiple pages of the same content on the same Web site. For example, the English and Chinese version of the Web page, they are the same content, but the use of language is different. When the browser's default language is English or Chinese, web pages with the same URL are displayed in the English or Chinese version. Such a mechanism is called content negotiation (negotiation).

The content negotiation mechanism refers to the client and server to negotiate the content of the response, and then provides the most suitable resources for the client. Content negotiation is a benchmark for judging the language , character set , encoding , etc. of the resource in response .

Some of the header fields included in the request message (below) are the benchmarks of the judgments (the detailed descriptions of these header fields are explained later):

    • Accept

    • Accept-charset

    • Accept-encoding

    • Accept-language

    • Content-language

The following 3 types of content negotiation technologies are available:

    • Server-driven negotiation (Server-driven negotiation): Content negotiation by the server side. The requested header field is referenced and processed automatically on the server side. But for users, the information sent by the browser as the basis for decision, and not necessarily be able to sift out the best content.

    • client-side driver negotiation (Agent-driven negotiation): How content is negotiated by the client. The user selects manually from the list of selectable options displayed in the browser. You can also use JavaScript scripts to automatically make these choices on a Web page. For example, by the type of OS or browser type, you switch to the PC version of the page or mobile version of the page.

    • Transparent Negotiation (Transparent negotiation): A combination of server-driven and client-driven, which is a way for the server-side and client to negotiate content on their own.


Content negotiation of HTTP messages within HTTP messages returns the most appropriate content

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.