I\'m using Spring reactive WebClient for sending requests to a http server. Inorder to view the underlying request & response that\'s being sent, I enabled debug logging for
You can do it with doOnNext(), if you use DataBuffer as your reader:
public Mono selectByPost(ServerRequest request) {
Flux requestBodyFlux = request.bodyToFlux(DataBuffer.class)
.doOnNext(dataBuffer -> {
if (debug ) {
log.debug(new String(dataBuffer.asByteBuffer().array()));
}
Scannable.from(dataBuffer).tags().forEach(System.out::println);
});
}
This is probably not the best way to do it, it would of course be a nice feature, if netty would provide different ways of logging the payload. Hex does have its benefits, depending on what you need to debug.