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 |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India