private String getHtmlCharset(String contentType, byte[] contentBytes, Task task) throws IOException {
        String charset = CharsetUtils.detectCharset(contentType, contentBytes);
        if (charset == null) {
            charset = Optional.ofNullable(task.getSite().getDefaultCharset()).orElseGet(Charset.defaultCharset()::name);
        }
        return charset;
    }
The http downloader based on HttpClient.

@author code4crafter@gmail.com <br>
@since 0.1.0
webmagic-core/src/main/java/us/codecraft/webmagic/downloader/HttpClientDownloader.java