日期:2014-05-17 浏览次数:20739 次
HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod(url);
try
{
int result = httpClient.executeMethod(getMethod);
System.out.println(result);
}
catch (HttpException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (getMethod != null)
{
getMethod.releaseConnection();
}
}