WebClient is part of Spring 5’s reactive web framework called Spring WebFlux.

 To use WebClient, you need to include the spring-webflux module in your project.

Add Dependency in an existing Spring Boot project

If you have an existing Spring Boot project, you can add the spring-webflux module by adding the following dependency in the pom.xml file -

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

Spring Boot version 2.x.x is needed for using the Spring WebFlux module.

Comments