Created
May 14, 2019 10:47
-
-
Save bhawna94/0f66e1a50d4b1274fc8516b5a38ae5c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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