July 2018
Intermediate to advanced
268 pages
7h 36m
English
A WebClient instance can be created by using the create() method, or by using the builder() method. In our sample, we have used the builder() method, as follows:
@Servicepublic class WebClientTestImpl implements WebClientTestInterface { private final WebClient webClient; public WebClientTestImpl(WebClient.Builder webClientBuilder) { this.webClient = webClientBuilder.defaultHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE) .baseUrl("http://localhost:8080/api/movie").build(); } //...Other methods}
We will be using all of the endpoints that we have created earlier in our base Spring WebFlux project, and will be accessing them using the WebClient.
Use the create() method to create an instance of WebClient ...
Read now
Unlock full access