try {
HttpResponse response = client.execute(method);
Status status = Status.fromHttpCode(response.getStatusLine().getStatusCode());
if (!acceptsMimeType(response.getLastHeader("Content-Type"))) {
return new RejectedMimeTypePage(url, status, response.getLastHeader("Content-Type").getValue());
}
if (Status.OK.equals(status)) {
CharsetDetector detector = new CharsetDetector();
detector.setText(read(response.getEntity().getContent()));