URL u;
URLConnection uc;
String header;
for (int i=0; i < args.length; i++) {
try {
u = new URL(args[i]);
uc = u.openConnection();
for (int j = 1; ; j++) {
header = uc.getHeaderField(j);
if (header == null) break;
System.out.println(uc.getHeaderFieldKey(j) + " " + header);
} // end for
} // end try
catch (MalformedURLException e) {
System.err.println(args[i] + " is not a URL I understand.");
}
catch (IOException e) {
System.err.println(e);
}
} // end for