Setting headers example

In this post under Spring WebClient, I will explain with example how to set headers before making a HTTP call. Below is the complete code for your reference Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.ClientResponse; 4 import org.springframework.web.reactive.function.client.WebClient; 5 6 import reactor.core.publisher.Mono; 7 8 public class Example5 { 9 public static void main(String[]…… Continue reading Setting headers example

Setting accept header example

In this post under Spring WebClient, I will explain with example how to set “ACCEPT” header before sending an HTTP GET request. Below is the complete main code for your reference. Main class 1 package defaultPackage; 2 3 import org.springframework.http.MediaType; 4 import org.springframework.web.reactive.function.client.ClientResponse; 5 import org.springframework.web.reactive.function.client.WebClient; 6 7 import reactor.core.publisher.Mono; 8 9 public class Example6…… Continue reading Setting accept header example

Simple Delete example

In this post under Spring WebClient, I will explain with example how to perform simple DELETE HTTP request. Below is the complete code for your reference. Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.ClientResponse; 4 import org.springframework.web.reactive.function.client.WebClient; 5 6 import reactor.core.publisher.Mono; 7 8 public class Example4 { 9 public static void main(String[] args) throws…… Continue reading Simple Delete example

Simple Put example

In this post under WebClient, I will show with example how to make a simple PUT HTTP request using WebClient framework. Below is the complete main method for your reference Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.WebClient; 4 import reactor.core.publisher.Mono; 5 6 public class Example3 { 7 public static void main(String[] args) throws…… Continue reading Simple Put example

Simple Post example

In this post under WebClient, I will show with example how to make a simple POST HTTP request using WebClient framework. Below is the complete main method for your reference Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.WebClient; 4 import reactor.core.publisher.Mono; 5 6 public class Example2 { 7 public static void main(String[] args) throws…… Continue reading Simple Post example

Simple Get example

In this post under WebClient, I will show with example how to make a simple GET HTTP request using WebClient framework. Below is the complete main method for your reference Main class 1 package defaultPackage; 2 3 import org.springframework.web.reactive.function.client.WebClient; 4 5 import reactor.core.publisher.Mono; 6 7 public class Example1 { 8 public static void main(String[] args)…… Continue reading Simple Get example

assumingThat example

In this post under JUnit, I will explain the purpose of “assumingThat” assertion method. In my previous postAssumptions in JUnit 5 I showed you how to use “assumeTrue” and “assumeFalse” assumption statements. Lets add that code here again for recap Below is the class to be tested. MockUserRepository package package14;public class MockUserRepository { private boolean…… Continue reading assumingThat example