@Override
    public <T> T execute(
            final HttpHost target,
            final ClassicHttpRequest request,
            final HttpContext context,
            final HttpClientResponseHandler<? extends T> responseHandler) throws IOException {
        Args.notNull(responseHandler, "Response handler");

        try (final ClassicHttpResponse response = doExecute(target, request, context)) {
            try {
                final T result = responseHandler.handleResponse(response);
                final HttpEntity entity = response.getEntity();
                EntityUtils.consume(entity);
                return result;
            } catch (final HttpException t) {
                // Try to salvage the underlying connection in case of a protocol exception
                final HttpEntity entity = response.getEntity();
                try {
                    EntityUtils.consume(entity);
                } catch (final Exception t2) {
                    // Log this exception. The original exception is more
                    // important and will be thrown to the caller.
                    LOG.warn("Error consuming content after an exception.", t2);
                }
                throw new ClientProtocolException(t);
            }
        }
    }
Executes a request using the default context and processes the
response using the given response handler. The content entity associated
with the response is fully consumed and the underlying connection is
released back to the connection manager automatically in all cases
relieving individual {@link HttpClientResponseHandler}s from having to manage
resource deallocation internally.

@param target    the target host for the request.
                 Implementations may accept {@code null}
                 if they can still determine a route, for example
                 to a default target or by inspecting the request.
@param request   the request to execute
@param context   the context to use for the execution, or
                 {@code null} to use the default context
@param responseHandler the response handler

@return  the response object as generated by the response handler.
@throws IOException in case of a problem or the connection was aborted
@throws ClientProtocolException in case of an http protocol error
httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/CloseableHttpClient.java