HTTP - User Agent Header

About

An HTTP user-agent is a http header that sends the user agent string. It identifies the HTTP client (even when the client is not operated by a user).

Example

Browser

Generally, a user is using a a browser as HTTP client. In this case, the user-agent would have the value of the browser

Example with a Javascript script that shows you the user-agent of your browser.

console.log("The navigator user agent that you are using is: "+navigator.userAgent);

App

A client (user agent) may also be an app (most well known as a bot).

Example for Google Bot:

Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

Not real identifier

Browsers identify themselves with this string but the User Agent string may change legally in few cases.

Following examples are the same user agent

  • A smartphone whose screen rotated since the last request
Mozilla/5.0 (Linux; U; Android 2.2; en-us; DROID2 Build/VZW) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 854X480 motorola DROID2
Mozilla/5.0 (Linux; U; Android 2.2; en-us; DROID2 Build/VZW) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 480X854 motorola DROID2

  • Internet Explorer compatibility mode:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

  • A user accessing a web site through a proxy distributed across multiple servers, not all of which are upgraded to the latest version of the proxy software
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (FlipboardProxy/0.0.5; +http://flipboard.com/browserproxy)
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (FlipboardProxy/1.1; +http://flipboard.com/browserproxy)

Management

Modification

In Internet explorer with the devtool

  • F12
  • Then

Ie Change User Agent String

Parser

See:

Documentation / Reference





Recommended Pages
(HTTP|HTTPS) - Hypertext Transfer Protocol

Hypertext Transfer Protocol (HTTP) is the transfer protocol to exchange or transfer web resource between nodes (host). The H in HTTP means an hypertext (ie HTML). The protocol was first designed...
Browser
Browser Capabilities Project (browscap or BCP)

The Browser Capabilities Project provides a database (a browscap.ini file) that list: known browsers and bots, along with their default capabilities and limitations. By parsing the useragent headers,...
Cookie Expiration
Cookie - Expiration

The expiration date is a calculated field that define the of validity of a cookie in time. It is defined by the user agent (ie browser) via the following cookie properties: the and/or the ...
HTTP - Client (User agents)

in HTTP. An HTTP client in HTTP is also known as the user agents because user-agent is the name of a header field that identify the client. HTTP identifies the client (ie user-agent_ using the user-agent...
HTTP - Content Type Header

The Content-Type is header that specify the mime type of the body of: a request or a response. mime typerequestaccept header Resources MIME type HTML text/html JSON text/json XML text/xml...
HTTP - Content-Disposition Header (Save as)

The content-disposition HTTP header indicates to the browser if the resource can be shown in the browser or should be downloaded (ie save as)
Chrome Cookies
HTTP - Cookie (Set-Cookie Header )

A cookie is a key-value data and some associated It is: set: by the server side with a HTTP response and the Set-Cookie header and eventually on a client side with the browser web api stored...
Windows Internet Properties Proxy
HTTP - Forward Proxy

A forward proxy is a proxy application that is configured to intercept and forward every internal Http request to an destination website, hence the name Forward Proxy. It's also known as man-in-the-middle...
HTTP - Gateway (Reverse Proxy)

A reverse proxy (or gateway) is a proxy that is configured to appear to the client just like an ordinary web server. Traffic from the internet at large enters system through reverse proxy, which then...
Chrome Devtool Har
HTTP - Request

An HTTP request is a message sent from a client to a server. It's the first part of a fetch, the second being the response. A request message has: a first line called the request...



Share this page:
Follow us:
Task Runner