java.net.HttpURLConnection allows applications to instruct whether HTTP request redirects (from the server) should be "followed". It has the setFollowRedirects(boolean) and setInstanceFollowRedirects(boolean) methods which allow applications to control this behaviour.
The implementation of HttpURLConnection in the JDK has some specific rules when it comes to following redirects. For example, in some cases, if the original request was a POST and the server redirected that request using the standard HTTP responde code(s), then the HttpURLConnection may use GET for the redirected location. This and some other details aren't currently documented. It would be good to have the relevant parts of this behaviour specified for those methods.
The implementation of HttpURLConnection in the JDK has some specific rules when it comes to following redirects. For example, in some cases, if the original request was a POST and the server redirected that request using the standard HTTP responde code(s), then the HttpURLConnection may use GET for the redirected location. This and some other details aren't currently documented. It would be good to have the relevant parts of this behaviour specified for those methods.