hi all, I'm doing a basic HEAD request using httpclient library. I'm curious how I'd be able to get the character set that apache returns E.g.: utf-8, iso-8859-1, etc... thanks!
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, 2000);
HttpConnectionParams.setSoTimeout(httpParams, 2000);
DefaultHttpClient httpclient = new DefaultHttpClient(httpParams);
httpclient.getParams().setParameter("http.useragent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
HttpContext localContext = new BasicHttpContext();
httpget = new HttpHead(url);
HttpResponse response = httpclient.execute(httpget, localContext);
this.sparrowResult.statusCode = response.getStatusLine().getStatusCode();
WORKING RESULT UPDATED
Header contentType = response.getFirstHeader("Content-Type");
String charset= contentType.getValue();