Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  private static String receiveFromBackEnd(String url, List<BasicNameValuePair> list) throws IOException, JSONException {
  2.         StringBuilder str = new StringBuilder();
  3.  
  4.         HttpClient httpclient = new DefaultHttpClient();
  5.         HttpGet httpGet = new HttpGet(url+"?"+ URLEncodedUtils.format(list,"utf-8"));
  6.         httpGet.addHeader(new BasicHeader("Content-Type",
  7.                 "application/json"));
  8.  
  9.         HttpResponse response = httpclient.execute(httpGet);
  10.  
  11.         BufferedReader reader = new BufferedReader(new InputStreamReader(
  12.                 response.getEntity().getContent()));
  13.         String line;
  14.         while ((line = reader.readLine()) != null) {
  15.             str.append(line);
  16.         }
  17.  
  18.         return str.toString();
  19.     }