public static InputStream linkUrl(String httpUrl) {
HttpGet hg = new HttpGet(httpUrl);
HttpClient hc = new DefaultHttpClient();
try {
HttpResponse response = hc.execute(hg);
if (response.getStatusLine().getStatusCode() == 200) {
HttpEntity entity = response.getEntity();
return entity.getContent();
}
} catch (ClientProtocolException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
return null;
}
5021

被折叠的 条评论
为什么被折叠?



