HttpURLConnection Disconnect() Example
Indicates that other requests to the server are unlikely in the near future.
HttpURLConnectionclass Disconnect() method example. This example shows you how to use Disconnect() method.This method Indicates that other requests to the server are unlikely in the near future.
Here is the code:-
/*
* @Program that Indicates that other requests to the server are unlikely in
the near future.
* Disconnect.java
* Author:-RoseIndia Team
* Date:-25-Jun-2008
*/
import java.net.*;
public class Disconnect {
public static void main(String[] args) throws Exception {
URL url = new URL("http://192.168.10.211:8080");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.disconnect();
// Indicates that other requests to the server are unlikely in the near future.
System.out.println("Connection disconnected");
}
} |
|