Old news to some, but there's more than just 301 and 302.
Java does list most of these, though not in order, so easy to overlook, and oddly 307 is not listed.
Wikipedia lists 7 redirect codes:
http://en.wikipedia.org/wiki/URL_redirection#HTTP_status_codes_3xx
Java has names for most of these in java.net.HttpURLConnection constant fields, though not 307:
http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html#field_summary
Table of status codes and named Java constants (301 and 302 are the standard ones of course):
- 300 multiple choices (e.g. offer different languages) HTTP_MULT_CHOICE
- 301 moved permanently HTTP_MOVED_PERM
- 302 found (e.g. temporary redirect) HTTP_MOVED_PERM
- 303 see other (e.g. for results of cgi-scripts) HTTP_SEE_OTHER
- 304 not modified HTTP_NOT_MODIFIED
- 305 use proxy HTTP_USE_PROXY
(no, there is no 306) - 307 temporary redirect (not listed in Java)
Comments