Questions tagged [user-agent]

A user agent is a piece of software (a software agent) that acts on behalf of a user. The term is often used to refer to browsers, and other software that sends network requests. In the HTTP protocol, a user agent identifies itself to the server using a user-agent string. The user-agent string is a string in the header of an HTTP request that identifies the browser, version, device, os, and other information about the device from which the request came.

A user agent is a piece of software (a software agent) that acts on behalf of a user. The term is often used to refer to browsers, and other software that sends network requests. In the HTTP protocol, a user agent identifies itself to the server using a user-agent string. The user-agent string is a string in the header of an HTTP request that identifies the browser, version, device, os, and other information about the device from which the request came.

The user-agent usually consists of the web browser type, the client operating system and device identifier (all with versions or builds). There is not particular standard in how to formulate an user-agent, but browser and device vendors typically standardize within their own scope.

Detection User-agent detection can be hard, especially in the mobile world. Identification of client capabilities usually cannot be done via the user-agent, but must be obtained by looking up the user-agent in a database. The defacto standard user-agent for a device is the one created by its web browser.

2389 questions
58
votes
11 answers

How to recognize Facebook User-Agent

When sharing one of my pages on FB, I want to display something different. Problem is, I prefer not to use the og: elements, but to recognize FB user-agent. What is it? I can't find it.
Himberjack
  • 5,682
  • 18
  • 71
  • 115
58
votes
6 answers

Set useragent in WKWebview

How do I set a custom useragent string in a WKWebView? I'm trying to embed the version of my app so that my server-side can see what features are available. I found the following method: let userAgent = "MyApp/1.33.7" request.setValue(userAgent,…
Pvel
  • 670
  • 1
  • 5
  • 11
57
votes
7 answers

Operating System from User-Agent HTTP Header

Is there a good, up-to-date listing anywhere that maps User-Agent HTTP Header strings --> operating systems?
C. Dragon 76
  • 9,882
  • 9
  • 34
  • 41
57
votes
3 answers

Sites not accepting wget user agent header

When I run this command: wget --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" http://yahoo.com ...I get this result (with nothing else in the file):