Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 25th, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Selenium 2: Detect content type of link destinations
  2. HttpClient httpclient = new DefaultHttpClient();
  3. HttpHead httphead = new HttpHead("http://foo/bar");
  4. HttpResponse response = httpclient.execute(httphead);
  5. BasicHeader contenttypeheader = response.getFirstHeader("Content-Type");
  6.  
  7. System.out.println(contenttypeheader);