ITPub博客

首页 > IT基础架构 > 网络安全 > HttpClient 简单例子

HttpClient 简单例子

原创 网络安全 作者:okone96 时间:2007-05-08 17:22:26 0 删除 编辑
private boolean sendURL(String url) {
boolean right = false;
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
try {
client.executeMethod(method);
right = true;
}catch (Exception e) {
log.error(e, e.fillInStackTrace());
right = false;
} finally {
method.releaseConnection();
}
return right;
}[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/750220/viewspace-914043/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    83
  • 访问量
    198460