@Override
  public Completes<Response> requestWith(final Request request, final Completes<Response> completes) {
    RequestHeader correlationId = request.headers.headerOf(RequestHeader.XCorrelationID);

    final Request readyRequest;

    if (correlationId == null) {
      correlationId = RequestHeader.of(RequestHeader.XCorrelationID, UUID.randomUUID().toString());
      readyRequest = request.and(correlationId);
    } else {
      readyRequest = request;
    }

    completables.put(correlationId.value, stage().world().completesFor(completes));

    state.buffer.clear();
    state.buffer.put(Converters.textToBytes(readyRequest.toString()));
    state.buffer.flip();
    state.channel.requestWith(state.buffer);

    return completes;
  }
@ Override public Completes < Response > requestWith ( final Request request , final Completes < Response > completes ) { RequestHeader correlationId = request . headers . headerOf ( RequestHeader . XCorrelationID ) ; final Request readyRequest ; if ( correlationId == null ) { correlationId = RequestHeader . of ( RequestHeader . XCorrelationID , UUID . randomUUID ( ) . toString ( ) ) ; readyRequest = request . and ( correlationId ) ; } else { readyRequest = request ; } completables . put ( correlationId . value , stage ( ) . world ( ) . completesFor ( completes ) ) ; state . buffer . clear ( ) ; state . buffer . put ( Converters . textToBytes ( readyRequest . toString ( ) ) ) ; state . buffer . flip ( ) ; state . channel . requestWith ( state . buffer ) ; return completes ; }
@see io.vlingo.http.resource.ClientConsumer#requestWith(io.vlingo.http.Request, io.vlingo.common.Completes)