@Override
    public boolean sendMessageToEndPoint(final HttpMessage message) {
        try {
            val request = new HttpPost(message.getUrl().toURI());
            request.addHeader(HttpHeaders.CONTENT_TYPE, message.getContentType());
            val entity = new StringEntity(message.getMessage(), ContentType.create(message.getContentType()));
            request.setEntity(entity);

            val handler = (HttpClientResponseHandler<Boolean>) response -> response.getCode() == HttpStatus.SC_OK;
            LOGGER.trace("Created HTTP post message payload [{}]", request);
            val task = this.requestExecutorService.execute(request, HttpClientContext.create(), handler);
            return message.isAsynchronous() || task.get();
        } catch (final RejectedExecutionException e) {
            LoggingUtils.warn(LOGGER, e);
            return false;
        } catch (final Exception e) {
            LOGGER.debug("Unable to send message", e);
            return false;
        }
    }
Implementation of CAS {@link HttpClient}
which delegates requests to a {@link #wrappedHttpClient} instance.

@author Jerome Leleu
@author Scott Battaglia
@author Misagh Moayyed
@since 3.1
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/http/SimpleHttpClient.java