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"));
More Related Contents:
- Android 8: Cleartext HTTP traffic not permitted
- How to send a “multipart/form-data” POST in Android with Volley
- Sending files using POST with HttpURLConnection
- How do I send a file in Android from a mobile device to server using http?
- How do I use the Simple HTTP client in Android? [closed]
- SecurityException: Permission denied (missing INTERNET permission?)
- How to create a HTTP server in Android? [closed]
- How to do a HTTP Post in Android?
- Android: HTTP communication should use “Accept-Encoding: gzip”
- Checking internet connection on android
- How to solve SocketException: Failed host lookup: ‘www.xyz.com’ (OS Error: No address associated with hostname, errno = 7)
- Upload a file through an HTTP form, via MultipartEntityBuilder, with a progress bar
- Using NanoHTTPD in Android
- java.io.IOException: Hostname was not verified [duplicate]
- Open Android app from URL using intent-filter not working
- HttpClient on Android : NoHttpResponseException through UMTS/3G
- Android httpclient file upload data corruption and timeout issues
- HTTP Request in Android with Kotlin
- Android: UnknownHostException
- Get HTTP Status Code in Android WebView
- HTTP doesn’t work in Android emulator
- How users/developers can set the Android’s proxy configuration for versions 2.x?
- Two way sync for cookies between HttpURLConnection (java.net.CookieManager) and WebView (android.webkit.CookieManager)
- How to use separate thread to perform http requests
- android – how to prevent webview to load when no internet connection
- How to keep a XMPP connection stable on Android with (a)smack?
- How to prevent Android from returning a cached response to my HTTP Request?
- Get signal strength of WIFI and Mobile Data
- How to check the HDMI device connection status in Android?
- Error java.lang.RuntimeException: Stub! in Android with Fitnesse testing