Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.net.HttpURLConnection;
- import java.net.URL;
- public class LocalHostRefresher {
- public static void main( String[] args ) throws Exception {
- get("http://192.168.0.100/restart.php");
- get("http://192.168.0.106/restart.php");
- }
- // HTTP GET request
- private static void get( String input ) throws Exception {
- URL url = new URL( input );
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setRequestProperty( "User-Agent", "LocalHostRefresher/1.0" );
- int responseCode = connection.getResponseCode();
- System.out.println( "HTTP GET " + url );
- System.out.println( " Response Code : " + responseCode );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement