WebClient makes it possible to perform reactive non-blocking HTTP requests in Spring applications. Use this tag for any questions involving its usage.
Questions tagged [spring-webclient]
992 questions
0
votes
2 answers
Cannot parse Google geocode json object via webclient
I try to call following webclient query:
return webClient
.get()
.uri(uriBuilder -> uriBuilder
.path("/geocode/json")
.queryParam("key", google.getApiKey())
…

user1089362
- 546
- 7
- 29
0
votes
1 answer
Is a Setter required in a DTO for parsing an API JSON response through Spring web client?
I am working on an application where I'm calling an API, retrieving the response and parsing it into a DTO. Now the response DTO I have defined is something like below,
@Getter
@JsonIgnoreProperties(ignoreUnknown = true)
public class…

Swastik Gupta
- 149
- 1
- 1
- 12
0
votes
2 answers
Spring webflux 5.2.3 bodyToMono called after empty Mono in onStatus
I've created a WebClient to make a get request, and to specifically handle the 404 error I'm using the onStatus method as shown in the snippet below.
client.get()
.uri(someUrl)
.headers(someHeaders)
…

Dheeraj Raisinghani
- 27
- 1
- 9
0
votes
3 answers
Webflux producer consumer problem (webClient)
Hi I have problem with WebFlux and backpressure:
Flux.range(0, 100)
.flatMap((Integer y) -> {
return reallySlowApi();
})
.doOnEach((Signal x1) -> {
log("next-------"…

John Tribe
- 1,407
- 14
- 26
0
votes
0 answers
WebClient Post: WebClientResponseException$InternalServerError
I have an API endpoint at http://localhost:8080/api/v1/accounts that I can successfully use to create an account using the POST-method. However, when I try to call this API from a program running on port 8081 using WebClient, I encounter an error…

Gykonik
- 638
- 1
- 7
- 24
0
votes
1 answer
Spring WebClient POST and Content Length Header for application/x-www-form-urlencoded
I am using Spring WebClient and Spring Boot 2.3.5.RELEASE to POST a request to a site that wants a Content Type of application/x-www-form-urlencoded. It keeps failing because the Content-Length header is not set. I can set that in the code, but…

user925406
- 65
- 2
- 11
0
votes
3 answers
how to display on console the json body of a webClient transmitted as a payload?
i use spring webClient and have a code like this :
public String HttpCall() {
Insurer insurer = new Insurer();
insurer.setName(“Axa”);
insurer.setId(“T-185785”);
ClientResponse response = webclient.post()
…

electrode
- 205
- 1
- 4
- 16
0
votes
0 answers
Spring Reactive Application Stuck Indefinitely
I started working on spring-webflux, and unfortunately, my application stuck for an indefinite time.
I have two applications one is reactive and another one is non-reactive.
Application A (NonReactive) makes requests to Application B (Reactive)…

Atul
- 133
- 3
- 12
0
votes
2 answers
Replace HTTPClient with WebClient in Java
String url = "https://localhost:8080/api/V1/hr/Auth";
HttpClient client = httpClientFactory.getHttpClient();
HttpPost request = new HttpPost(url);
request.addHeader("content-type", "application/json");
…

Radhika Mantri
- 197
- 1
- 15
0
votes
0 answers
Spring Webclient - Site Failover on Error
I'm attempting to create a library that leverages Spring Webclient that has common failure logic for all of our applications. There are 2 considerations - configurable retry logic and failover logic to secondary sites.
The failover needs to handle…

Daire
- 11
- 2
0
votes
1 answer
How to add the OAuth 2.0 bearer token to WebClient
This is the error response I get when using WebClient currently
{
"type": "https://www.jhipster.tech/problem/problem-with-message",
"title": "Internal Server Error",
"status": 500,
"detail": "401 Unauthorized from GET…

Kevin
- 1
- 1
0
votes
1 answer
How to process large response using Spring WebClient without buffering it first
We want to process large response (tens of MB) using Spring WebClient. We are encountering org.springframework.core.io.buffer.DataBufferLimitException as discussed here. But we do not want to increase the buffer size. We are only using a small…

Lukas
- 13,606
- 9
- 31
- 40
0
votes
0 answers
Cannot deserialize instance of POJO out of START_ARRAY token
I'm using merriam webster API and for some words, i get this error. I tried to see the difference between words and found that some of them are missing a property, in this case It's app-shortdef, which is a POJO class that i've created.
As I said,…

Roberto
- 3
- 2
0
votes
1 answer
Webclient post call never receiving a response in Intellij
I have written a webclient instance in a Java application. I've created a ssl context to use with the server I am trying to hit, as well as basic authentication. I am making a REST Post request. At first I had doubts that I'd properly created the…

AmateurPCB
- 33
- 1
- 6
0
votes
1 answer
Send an Object with a large List with Spring's WebClient
I have an object with some attributes and a very large list of another object. it looks like this:
public class Company {
private String attr1;
private String attr2;
private long attr3;
private List employees; // very…

Cambiasso
- 113
- 1
- 13