Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static String receiveFromBackEnd(String url, List<BasicNameValuePair> list) throws IOException, JSONException {
- StringBuilder str = new StringBuilder();
- HttpClient httpclient = new DefaultHttpClient();
- HttpGet httpGet = new HttpGet(url+"?"+ URLEncodedUtils.format(list,"utf-8"));
- httpGet.addHeader(new BasicHeader("Content-Type",
- "application/json"));
- HttpResponse response = httpclient.execute(httpGet);
- BufferedReader reader = new BufferedReader(new InputStreamReader(
- response.getEntity().getContent()));
- String line;
- while ((line = reader.readLine()) != null) {
- str.append(line);
- }
- return str.toString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement