Android HTTP User Agent

后端 未结 4 1619
生来不讨喜
生来不讨喜 2020-11-27 13:58

How do I get the real device in http_user_agent? When I use a WebView, I can get the real value like this:

[HTTP_USER_AGENT] => Mozilla/5.0(Linux; U; And         


        
4条回答
  •  温柔的废话
    2020-11-27 14:23

    To complete the accepted answer, if you want the default user agent use System.getProperty("http.agent")

    client.getParams().setParameter(CoreProtocolPNames.USER_AGENT,
                                    System.getProperty("http.agent"));
    

提交回复
热议问题