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

HTTP Headers

Sec CH UA Mobile

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-Mobile</code> request header is a user agent client hint which indicates whether the browser is on a mobile device.
It can also be used by a desktop browser to indicate a preference for a “mobile” user experience.

Sec-CH-UA-Mobile is a low entropy hint.
Unless blocked by a user agent permission policy, it is sent by default, without the server opting in by sending <code>Accept-CH</code>.

Header typeRequest header,
Client hint
Forbidden request headerYes (Sec- prefix)

Syntax

Syntax

http
Sec-CH-UA-Mobile: &lt;boolean&gt;

Directives

<boolean>

<code>?1</code> indicates that the user-agent prefers a mobile experience (true).<br><code>?0</code> indicates that user-agent does not prefer a mobile experience (false).

Example

Examples

Using Sec-CH-UA-Mobile

Since Sec-CH-UA-Mobile is a low entropy hint, it is typically included in all requests.
A desktop browser usually sends requests with the following header:

Sec-CH-UA-Mobile: ?0

A browser on a mobile device generally includes the following header in its requests:

Sec-CH-UA-Mobile: ?1

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Sec-CH-UA-Mobile header. This is useful for testing how your website or app behaves when accessed from different types of devices, such as mobile or desktop. Steps to Modify the Sec-CH-UA-Mobile 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-Mobile.
    • In the “Header Value” field, enter either ?1 to simulate a mobile device or ?0 for desktop.
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-website.com/*).
  5. Save the rule.

Once applied, Requestly will inject the Sec-CH-UA-Mobile header with your chosen value into matching requests. This helps you test how your site adapts to mobile versus desktop environments without needing to switch actual devices.