I’m using HttpClient together with HttpGet to download a few websites. They’re detecting that the website is accessed from a mobile device through the http headers and they’re consequently returning the mobile version of the respective page.
I want to download the normal version, so I have to stop HttpClient from telling the site that it’s a mobile device. How do I do it?
I’ve tried:
HttpProtocolParams.setUserAgent(httpClient.getParams(), "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2");
But the mobile version still loads, so there must be few more headers that I need to overwrite.
Hit an endpoint that spits out the HTTP headers and then you can inspect whatever is being sent from your code and override whatever is necessary. I googled and found this (among others):
http://pgl.yoyo.org/http/browser-headers.php