
{filelink=9052}
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Date;
public class WebType
{
/***
* Les types de contenu retournés par cette fonction
* sont généralement les suivants:
* text/html, text/plain, image/gif,
* application/xml
* **/
public static void main(String args[]) throws Exception
{
URL url = new URL("http://www.exemple.com");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
System.out.println("Content-Type: " + conn.getContentType());
}
}