EDIT:
Try with:
HttpResponse httpResp = client.execute(response);
int code = httpResp.getStatusLine().getStatusCode();
The HttpStatus should be 200 ( HttpStatus.SC_OK
)
(I've read too fast the problem!)
Try with:
GetMethod getMethod = new GetMethod("http://www.example.com");
int res = client.executeMethod(getMethod);
This should do the trick!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…