Using HttpGet returning complete HTML code
I am trying to invoke a private web-service in which there's one link I've to access using GET method. While using the direct URL on browser (needs to login first), I get the data in JSON format. The URL I am invoking is like this http://www.example.com/trip/details/860720?format=json The url is working fine, but when I invoke this using HttpGet , I am getting the HTML coding of the webpage, instead of the JSON String. The code I am using is as follows: private String runURL(String src,int id) { //src="http://www.example.com/trip/details/" HttpClient httpclient = new DefaultHttpClient();