Javatpoint Logo
Javatpoint Logo

Java HttpURLConnection getFollowRedirects() Method

The getFollowRedirects() is the method of HttpURLConnection class. This method is used to indicate whether or not HTTP redirects (3xx) should be automatically followed.

Syntax

Returns

It returns true if HTTP redirects automatically followed else it returns false.

Example 1

Test it Now

Output:

getFollowRedirects : true
connecion disconnected

Example 2

Test it Now

Output:

getFollowRedirects :true
www.oracle.com
getFollowRedirects :true
connection disconnected





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA