HTTP headers | Accept-CH

The HTTP Accept-CH header is a response-type header that indicates the client hints that the server can support and should include in further requests.

Syntax:

Accept-CH: client hints

Note: The client hints can be more than one and are to be separated by commas.

Directives: The HTTP Accept-CH header accepts a single directive as mentioned above and described below:

  • client hints: This directive contains a set of HTTP request header fields for proactive content negotiation for indicating a list of device and agent specific preferences.

Below examples will illustrate the HTTP Accepts-CH header:



Examples:

  • When one client hint is used. In this example, Viewport-Width is the client hint and it indicates the layout viewport width in CSS pixels.
    Accept-CH: Viewport-Width
  • When multiple client hints are used. In this example Viewport-Width and Width are the client hints.
    Accept-CH: Viewport-Width, Width

To check the Accept-CH in action go to Inspect Element -> Network check the response header for Accept-CH like below.

Supported Browsers: The browsers are compatible with the HTTP Accept-CH header are listed below:

  • Google Chrome
  • Opera
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.