added exchange and retrieve examples as in teh article, updated due to deprecation

This commit is contained in:
Gerardo Roza 2021-01-22 10:49:47 -03:00
parent 10318d1145
commit 814369e38c
1 changed files with 6 additions and 2 deletions

View File

@ -72,8 +72,12 @@ public class WebClientController {
.ifNoneMatch("*")
.ifModifiedSince(ZonedDateTime.now())
.retrieve();
WebClient.ResponseSpec response2 = requestSpec2.retrieve();
String response2 = uri1.exchangeToMono(response -> response.bodyToMono(String.class))
.block();
String response3 = uri2.retrieve()
.bodyToMono(String.class)
.block();
WebClient.ResponseSpec response4 = requestSpec2.retrieve();
}
private WebClient createWebClient() {