🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Sec CH UA Model

HTTP Header

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The HTTP <code>Sec-CH-UA-Model</code> request header is a user agent client hint which indicates the device model on which the browser is running.

The header type is a Request header and a Client hint. This header is a forbidden request header with the Sec- prefix, meaning it cannot be set by scripts in web pages.

Syntax

Syntax

http
Sec-CH-UA-Model: <device-version>

Directives

<device-version>

A string containing the device version. For example “Pixel 3”.

Example

Using Sec-CH-UA-Model

A server requests the Sec-CH-UA-Model header by including Accept-CH in a response to any request from the client, using the name of the desired header as a token:

HTTP/1.1 200 OK
Accept-CH: Sec-CH-UA-Model

The client may choose to provide the hint, and add the Sec-CH-UA-Model header to subsequent requests.
For example, on a mobile phone, the client might include the header as shown:

GET /my/page HTTP/1.1
Host: example.site

Sec-CH-UA: " Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"
Sec-CH-UA-Mobile: ?1
Sec-CH-UA-Platform: "Android"
Sec-CH-UA-Bitness: "64"
Sec-CH-UA-Model: "Pixel 3 XL"

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Sec-CH-UA-Model header. This is especially useful for testing how your application adapts to different client device models or for debugging client hints sent by browsers. Steps to Modify the Sec-CH-UA-Model Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Sec-CH-UA-Model.
    • In the “Header Value” field, enter the desired device model value (e.g., “Pixel 5”).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once set up, Requestly will inject the Sec-CH-UA-Model header with your specified value into all matching requests, allowing you to simulate requests from different device models and test how your server handles client hints.

You might need to modify the Sec-CH-UA-Model header to see how your website or API reacts to different user device models. This can help in optimizing user experience for various devices or troubleshooting device-specific issues.