HTTP Headers
Sec CH UA Model
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
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
- Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
- Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
- 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”).
- Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
- 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.
Table of Contents
- No headings found.