URL url = new URL(args[i]);
URLConnection c = url.openConnection();
System.out.println( "---------------------------" );
System.out.println( args[i] );
System.out.println( "---------------------------" );
for( int j = 0; ; j++ ){
String value = c.getHeaderField(j);
if (value == null){ break; }
System.out.println(
((j==0)? "status: "
: (c.getHeaderFieldKey(j) + " = "))
+ value);
}
-_-_-
---------------------------
http://www.cis.ohio-state.edu/
---------------------------
status: HTTP/1.1 200 OK
Date = Mon, 01 Mar 2004 04:01:01 GMT
Server = Apache/1.3.26 (Unix) mod_ssl/2.8.10 OpenSSL/0.9.6e
Last-Modified = Fri, 20 Feb 2004 22:07:38 GMT
ETag = "2c036-57bf-4036852a"
Accept-Ranges = bytes
Content-Length = 22463
Keep-Alive = timeout=15, max=100
Connection = Keep-Alive
Content-Type = text/html
---------------------------
http://java.sun.com/
---------------------------
status: HTTP/1.1 200 OK
Server = Netscape-Enterprise/6.0
Date = Mon, 01 Mar 2004 04:00:15 GMT
Content-type = text/html;charset=ISO-8859-1
Set-cookie = JSESSIONID=java.sun.com-229a%253A4042b54f%253A5e5a802b0382d27;path=/;expires=Mon, 01-Mar-2004 04:30:15 GMT
Connection = close
---------------------------
http://www.theassayer.org/cgi-bin/asbrowsesubject.cgi
---------------------------
status: HTTP/1.1 200 OK
Date = Mon, 01 Mar 2004 04:05:17 GMT
Server = Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
Cache-control = private
Pragma = no-cache
Connection = close
Transfer-Encoding = chunked
Content-Type = text/html