Java HttpURLConnection setFollowRedirectsThe setFollowRedirects is the method of Java HttpURLConnection class. This method is used to set HTTP redirects(requests with response code 3xx). It returns true by default. SyntaxParameterset - It is a Boolean value. Check whether HTTP redirect or not. ThrowsSecurityException - This exception occurs if a security manager exists and checkSetFactory doesn't allow the operation. Example 1Test it NowOutput: getFollowRedirects : true connecion disconnected Example 2Test it NowOutput: getFollowRedirects :true www.oracle.com getFollowRedirects :true connection disconnected
Next TopicJava HttpURLConnection class
|