@Override
    public final void consumePromise(
            final HttpRequest promise,
            final HttpResponse response,
            final EntityDetails entityDetails,
            final HttpContext context) throws HttpException, IOException {
        if (entityDetails != null) {
            final ContentType contentType;
            try {
                contentType = ContentType.parse(entityDetails.getContentType());
            } catch (final UnsupportedCharsetException ex) {
                throw new UnsupportedEncodingException(ex.getMessage());
            }
            Charset charset = contentType != null ? contentType.getCharset() : null;
            if (charset == null) {
                charset = defaultCharset;
            }
            setCharset(charset);
            start(promise, response, contentType != null ? contentType : ContentType.DEFAULT_TEXT);
        } else {
            start(promise, response, null);
            completed();
        }
    }
Triggered to signal the beginning of data processing.

@param response the response message head
@param contentType the content type of the response body,
                   or {@code null} if the response does not enclose a response entity.
@throws HttpException If a protocol error occurs.
@throws IOException   If an I/O error occurs.
httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/AbstractCharPushConsumer.java