HttpClient get status code [duplicate]

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!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)