i developed external API by WebClient but i don't know how to check the response body..
public class Call {
public Mono<Object> get() {
Mono<Object> http = webClient.get()
.uri(EXTERNAL_URL)
.retrieve()
.bodyToMono(Object.class);
return http;
}
}
and test code
public class Test {
@Test
void test() {
Call call = new Call();
Mono<Object> mono = call.get();
mono.doOnSuccess(
r -> log.info(">>> r = {}", r) //
).subscribe() }
}
log content
>>> r = MonoMap
it just print "MonoMap".. how can i check response body??
Change your code as follows, it will deserialize the response to a string and return