请问JAVA这几句话什么意思
publicstaticInputStreamgetdata(StringurlStr){InputStreamis=null;HttpClientclient=newD...
public static InputStream getdata(String urlStr) {
InputStream is = null;
HttpClient client = new DefaultHttpClient();
try {
HttpGet get = new HttpGet(urlStr);
get.setHeader("referer",urlStr);
HttpResponse response = client.execute(get);
HttpEntity entity = response.getEntity();
is = entity.getContent();
} catch (Exception e) {
e.printStackTrace();
}
return is;
}
谢谢! 展开
InputStream is = null;
HttpClient client = new DefaultHttpClient();
try {
HttpGet get = new HttpGet(urlStr);
get.setHeader("referer",urlStr);
HttpResponse response = client.execute(get);
HttpEntity entity = response.getEntity();
is = entity.getContent();
} catch (Exception e) {
e.printStackTrace();
}
return is;
}
谢谢! 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询