HttpClient 簡單例子

okone96發表於2007-05-08
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部落格 ” ,連結:http://blog.itpub.net/750220/viewspace-914043/,如需轉載,請註明出處,否則將追究法律責任。

相關文章