I am trying to use the Java library to check the universe of possible HTTP responses, rather than writing my own logic to check each response code individually.
I found the static class Response.Status in javax.ws.rs , which seems to be perfect for this purpose. Its documentation states:
For commonly used status codes defined by HTTP, see the HTTP / 1.1 documentation for a complete list.
If you visit the link to the HTTP / 1.1 documents referenced by the javax documentation, it is clear that you see the 302 response status code as valid.
However, the following call returns null , which means that "the corresponding status or zero does not correspond to the status" - this is clearly not true:
Response.Status.fromStatusCode(302);
And, of course, 302 / FOUND not included in the enumeration defined in this class.
Does anyone know why this is? Is this oversight in javax.ws.rs code - or was it intentional?
source share