HttpURLConnection GetInstanceFollowRedirects() Example
Returns the value of this HttpURLConnection's instanceFollowRedirects field.
HttpURLConnectionclass GetInstanceFollowRedirects() method example. This example shows you how to use GetInstanceFollowRedirects() method.This method Returns the value of this HttpURLConnection's instanceFollowRedirects field.
Here is the code:-
/*
* @Program that Returns the value of this HttpURLConnection's
instanceFollowRedirects field.
* GetInstanceFollowRedirects.java
* Author:-RoseIndia Team
* Date:-25-Jun-2008
*/
import java.net.*;
public class GetInstanceFollowRedirects {
public static void main(String[] args) throws Exception {
URL url = new URL("http://192.168.10.211:8080");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
//Returns value of HttpURLConnection's instanceFollowRedirects field.
System.out.println("HttpURLConnection's instanceFollowRedirects: "
+connection.getInstanceFollowRedirects());
}
} |
Output of the program:-
| HttpURLConnection's instanceFollowRedirects: true |
|