In this post under Spring WebClient, I show with example how to receive a user defined Java object as a response of GET request. In all my previous post under Spring WebClient, I used to received data of type String class as part of GET request. Now in this example I will receive a user…… Continue reading Retrieving a user defined Java object as part of GET request
Category: Spring WebClient
Sending a user defined Java object as POST request
In this post under Spring WebClient, I will show with example how to send a user defined object as part of POST request. In all my previous post under Spring WebClient, I used to send data of type String class as part of POST request. Now in this example I will send a user defined…… Continue reading Sending a user defined Java object as POST request
WebClient.Builder example
In this post under Spring WebClient, I will explain with example the purpose and how to use “WebClient.Builder” class In all my previous post under Spring WebClient, whenever I need to create an instance of WebClient, I used the below approach WebClient webClient = WebClient.create(“https://jsonplaceholder.typicode.com”); This created an instance of “WebClient” class with default configurations…… Continue reading WebClient.Builder example
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