@Override
    public IHttpClientRequest request(String endpoint, HttpMethod method,
            IAsyncResultHandler<IHttpClientResponse> responseHandler) {

        URI pEndpoint = URI.create(endpoint);
        int port = pEndpoint.getPort();
    	String proto = pEndpoint.getScheme();
    	HttpClient client;
    	String pathAndQuery = getPathAndQuery(pEndpoint);

    	// If protocol provided
    	if (port != -1 || proto != null) {
    		if (port == 443 || "https".equals(proto)) { //$NON-NLS-1$
        		client = sslClient;
        		port = (port == -1) ? 443 : port;
    		} else {
        		client = plainClient;
        		port = (port == -1) ? 80 : port;
    		}
    	} else {
        	client = plainClient;
        	port = 80;
        }

        HttpClientRequest request = client.request(convertMethod(method),
                port,
                pEndpoint.getHost(),
                pathAndQuery,
                new HttpClientResponseImpl(responseHandler));

        request.setChunked(true);

        request.exceptionHandler(exception -> {
            logger.error("Exception in HttpClientRequestImpl: {0}", exception); //$NON-NLS-1$
        	responseHandler.handle(AsyncResultImpl.create(exception));
        });

        return new HttpClientRequestImpl(request);
    }
A Vert.x based implementation of {@link IHttpClientComponent}. Ensure that
{@link IHttpClientRequest#end()} is called after writing is finished, or your data may never be sent, and
the connection will be left hanging.

@author Marc Savy {@literal <msavy@redhat.com>}
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/components/HttpClientComponentImpl.java