docs: @SuppressWarnings("unchecked")
  	private <T> Future<T> doInvoke(String methodName, Object argument, Class<T> returnType, Map<String, String> extraHeaders, JsonRpcCallback<T> callback) {
  		
  		String path = serviceUrl.getPath() + (serviceUrl.getQuery() != null ? "?" + serviceUrl.getQuery() : "");
  		int port = serviceUrl.getPort() != -1 ? serviceUrl.getPort() : serviceUrl.getDefaultPort();
  		HttpRequest request = new BasicHttpEntityEnclosingRequest("POST", path);
  		
  		addHeaders(request, headers);
  		addHeaders(request, extraHeaders);
  		
  		try {
  			writeRequest(methodName, argument, request);
  		} catch (IOException e) {
  			callback.onError(e);
  		}
  		
  		HttpHost target = new HttpHost(serviceUrl.getHost(), port, serviceUrl.getProtocol());
  		BasicAsyncRequestProducer asyncRequestProducer = new BasicAsyncRequestProducer(target, request);
  		BasicAsyncResponseConsumer asyncResponseConsumer = new BasicAsyncResponseConsumer();
  		
  		RequestAsyncFuture<T> futureCallback = new RequestAsyncFuture<>(returnType, callback);
  		
  		BasicHttpContext httpContext = new BasicHttpContext();
  		requester.execute(asyncRequestProducer, asyncResponseConsumer, pool, httpContext, futureCallback);
  		
  		return (callback instanceof JsonRpcFuture ? (Future<T>) callback : null);
  	}