I\'m using the org.apache.http.HttpResponse class in my Java application, and I need to be able to get the HTTP status code. If I used .toString() on i
org.apache.http.HttpResponse
.toString()
I have used httpResponse.getStatusLine().getStatusCode() and have found this to reliably return the integer http status code.
httpResponse.getStatusLine().getStatusCode()