Does Java have a complete enum for HTTP response codes?
I don't think there's one that's complete in the standard Java classes; HttpURLConnection
is missing quite a few codes, like HTTP 100/Continue
.
There's a complete list in the Apache HttpComponents, though:
org.apache.http.HttpStatus
(replaced org.apache.commons.HttpClient.HttpStatus
from Apache Http Client, which reached end of life)
The Interface javax.servlet.http.HttpServletResponse
from the servlet API has all the response codes in the form of int
constants names SC_<description>
. See http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html