How to ping URL and get the status in java

In this post, we will see how to get ping URL and get status of it. We will use HttpURLConnection to connect to url and if response code is not 200, then it is not connected.

When you run above program, you will get below output:

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *