String result = "";
DefaultHttpClient httpclient = new DefaultHttpClient();
//设置超时事件
HttpConnectionParams.setConnectionTimeout(httpclient.getParams(), Constants.CONNECTIONTIMEOUTMILLIS);
HttpConnectionParams.setSoTimeout(httpclient.getParams(), Constants.SOCKETTIMEOUTMILLIS);
try {
HttpGet httpget = new HttpGet(url);
ResponseHandler
String responseBody = httpclient.execute(httpget, responseHandler);
result=responseBody;
logger.debug(" end!");
}catch(Exception e){
logger.debug(" error:"+e);
} finally {
httpclient.getConnectionManager().shutdown();
}
return result;