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
1 answer
Spring WebClient is retrieving bad Content-Type
When I run a WebClient as follows:
WebClient.create(apiUrl)
.get()
.uri(uriBuilder -> uriBuilder
.path("/some/{productId}/")
.queryParam("ws_key", apiKey)
…

Mr.Eddart
- 10,050
- 13
- 49
- 77
0
votes
1 answer
Springboot WebClient Broken in docker container
Iv created two Springboot applications that Iv dockerized and created local containers.
When I run the applications locally through intellij on my machine they work ok. Application A, on localhost:8080 has a Spring WebClient with a baseUrl…

rogger2016
- 821
- 3
- 11
- 28
0
votes
1 answer
Does mono.cache works for Webclient response?
I'm trying to cache an authentication token response which is returned by a webclient call.
public Mono getToken() {
return webclient.post().retrieve()
.bodyToMono(Token.class)
.cache(this::getTokenLiveDuration, t ->…

LunaticJape
- 1,446
- 4
- 21
- 39
0
votes
0 answers
What is the correct way to add a string to Spring WebClient Post Requestbody
I'm able to send my request through postman just fine with the body as
"bodytext"
but when I try sending it through my webclient
String bodyStr = "bodytext";
ResponseEntity response = webClient.post()
.uri("not/actual/uri")
…
0
votes
0 answers
How to extract any multi-layer nested T object from a JSON WebClient response, given consistent parent fields across all responses?
I'm building a SpringBoot Client (leveraging WebClient for the actual call) that will be retrieving data from a Vendor's REST API (so we have no control over the response structure). Regardless of the endpoint that is called, all responses are…

Cameron Meyer
- 65
- 1
- 9
0
votes
1 answer
spring Webclient generics Result.class not work
in spring webclient i want deserialize response in Result
'''
Mono> result = webClient
.get()
.uri("/leads?page="+page)
.header(HttpHeaders.AUTHORIZATION,"Bearer " + tocken)
…

Guido Salemme
- 27
- 3
0
votes
2 answers
Spring reactive webClient - how to call methods on a Mono
New to reactive programming and trying to create a reactive service via WebFlux and WebClient.
The flow of the method is like
POST request and wait for response back
Body of response to a mapping
service (which has some other business logic) and…

user130316
- 35
- 1
- 11
0
votes
1 answer
How to make concurrent WebClient calls in a blocking Spring MVC app?
I'm trying to make parallel rest api calls to 5 different backend systems. Each rest api has different endpoints and different response types. I tried to accomplish this by using Webclient. I'm not able to figure out how to "block" the Mono's…

venky
- 73
- 12
0
votes
1 answer
How to pass Error Body and StatusCode using Spring WebClient
I have a request like this:
public ResponseEntity test(String id) {
return WebClient
.create("http://localhost:8090/database/api")
.get()
.uri("/test/{id}", id)
.accept(MediaType.APPLICATION_JSON)
…

lucianojs
- 165
- 1
- 8
0
votes
1 answer
How to make chain of Mono/Flux and implement Retry in sping-webflux
I have a scenario with reactive/async call. I am using spring-boot-starter-webflux and using webclient to make external HTTP calls.
My scenario is I have to make a call to callA() and then check its response ResponseA. If its ResponseA is ok than…

Ashish Sharma
- 574
- 7
- 18
0
votes
1 answer
Spring WebFlux - a question about duplicating method invocation
I've created a synthetic application using Spring Reactive framework to investigate caching mechanics, that is proposed with Webflux.
What I've noticed, is that when I use a Webclient, that addresses to a third party URL, a method that uses it is…

Rassul Yunussov
- 35
- 1
- 4
0
votes
1 answer
WebClient URI template variables from bodyValue?
I recently encountered some unexpected behaviour and was wondering if this was in fact intended functionality when using WebClient. With a client config as shown below, the uri variables in the template are being overridden with the fields from a…

olan
- 3,568
- 5
- 24
- 30
0
votes
2 answers
SpringBoot WebFlux: Parsing Parallel WebClient Requests
I am making parallel rest calls to an API with the spring webclient.
The response looks like this
{
"d": {
"results": [
{
"id": "1",
"name": "Test A"
},
{
"id": "2",
…

kv0th3
- 1
0
votes
0 answers
Spring Webclient not able to create connections
I'm using Spring Webclient in a Spring Boot project to call a remote API
I've observed a strange behaviour with Webclient. Whenever the Remote API timeouts increase, Webclient goes into a state with very few active connections (less than 5, even…

Daanish Sarguru
- 83
- 1
- 8
0
votes
1 answer
Remote service call from webclient Java : Spring Webflux
I have a requirement where I have a 500+ ids in a request and I have to call a remote service .
But the problem is remote service is not performant so it gets timed out . So at max I can send only 100 ids in a request. Is there a way Spring WebFlux…

Suman G
- 11