Skip to content

Instantly share code, notes, and snippets.

@sjyun
Created March 18, 2014 13:00
Show Gist options
  • Save sjyun/9619577 to your computer and use it in GitHub Desktop.
Save sjyun/9619577 to your computer and use it in GitHub Desktop.
Header정보확인
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Date;
/**
*
* User: jins
* Date: 14. 3. 18
* Time: 오후 5:31
*
*/
public class HeaderTest {
public static void main(String ar[]){
try {
URL url = new URL("http://somehost.com/cgi-bin/acgi");
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("HEAD");
System.out.println(url + "수정일" + new Date(http.getLastModified()));
} catch (IOException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment