public static String getMyGson(String path){
try {
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(path);
HttpResponse httpResponse = httpClient.execute(httpGet);
int statusCode = httpResponse.getStatusLine().getStatusCode();
if(statusCode==200){
InputStream inputStream = httpResponse.getEntity().getContent();
ToStringUtils toStringUtils = new ToStringUtils();
String string = toStringUtils.getString(inputStream);
return string;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
try {
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(path);
HttpResponse httpResponse = httpClient.execute(httpGet);
int statusCode = httpResponse.getStatusLine().getStatusCode();
if(statusCode==200){
InputStream inputStream = httpResponse.getEntity().getContent();
ToStringUtils toStringUtils = new ToStringUtils();
String string = toStringUtils.getString(inputStream);
return string;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}