I am trying to make a GET request through an https endpoint, I'm not sure if there is any special treatment that is needed, but below is my code:
String foursquareURL = "https://api.foursquare.com/v2/venues/search?ll=" + latitude + "," + longitude + "&client_id="+CLIENT_ID+"&client_secret="+CLIENT_SECRET; System.out.println("Foursquare URL is " + foursquareURL); try { Log.v("HttpClient", "Preparing to create a request " + foursquareURL); URI foursquareURI = new URI(foursquareURL); HttpClient httpclient = new DefaultHttpClient(); HttpResponse response = httpclient.execute(new HttpGet(foursquareURI)); content = response.getEntity().getContent(); BufferedReader br = new BufferedReader(new InputStreamReader(content)); String strLine; String result = ""; while ((strLine = br.readLine()) != null) { result += strLine; }
source share