Java Whois example

In this tutorial, we will show you how to use Java library – “Apache Commons Net” to get WHOIS data of a domain. 1. Simple Java Whois Example For domain registered under internic.net, you can get the whois data directly. WhoisTest.java package com.mkyong.whois.bo; import java.io.IOException; import java.net.SocketException; import org.apache.commons.net.whois.WhoisClient; public class WhoisTest { public static …

Read more

Java HttpURLConnection follow redirect example

The HttpURLConnection‘s follow redirect is just an indicator, in fact it won’t help you to do the “real” http redirection, you still need to handle it manually. URL obj = new URL(url); HttpURLConnection conn = (HttpURLConnection) obj.openConnection(); conn.setInstanceFollowRedirects(true); //you still need to handle redirect manully. HttpURLConnection.setFollowRedirects(true); 1. Java Http Redirect Example If a server is …

Read more