Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public Mono<UserDetails> callToExternalService() {
return WebClient
.builder()
.baseUrl("https://jsonplaceholder.typicode.com")
.build()
.get()
.uri("posts/1")
.exchange()
.flatMap(clientResponse -> clientResponse.bodyToMono(UserDetails.class));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment