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 GET request fails with "Moved Permanently. Redirecting to"
I killed more than one day on this issue and could not understand root cause.
So, I am trying to make simple get request with WebClient from Webflux
WebClient webClient = WebClient.builder().build();
Mono stringMono = webClient.get()
…

Aslan
- 21
- 5
0
votes
2 answers
ResourceAccessException received instead HttpServerErrorException
I have invoked rest Api in my microservice using RestTemplate. However incase of exceptions i have returned error data with HTTP response code as 500. But when i receive this response in my microservice , it is received as ResourceAccessException…

Kumar
- 183
- 1
- 12
0
votes
0 answers
Can Webclient decode from iso-8859-1 to utf-8?
I faced a problem that the Jackson2JsonDecoder class always decodes content to UTF-8 charset, but I get content in iso-8859-1 and instead of viewing it correctly, I get unreadable chars.
For example, I recieve frühestens in iso-8859-1 and after…

EraCat
- 65
- 1
- 5
0
votes
1 answer
Spring WebTestClient can't parse body of parameterized type List>
I'm using Spring WebFlux (with Annotations) and have, among other similar (working) controllers:
@Override
public Flux> syncAccounts(
@RequestBody List> operations,
…

lfreire
- 103
- 9
0
votes
1 answer
Spring Boot WebClient with OAuth2 and use InsecureTrustManagerFactory
I have successfully implemented WebClient with oAuth2. Facing problem with oAuth2 when the Authentication Server (Keycloak) is having SSL (https). Though I am passing InsecureTrustManagerFactory while defining WebClient, this oAuth is called before…

Ram
- 845
- 1
- 13
- 26
0
votes
0 answers
Spring boot WebClient asynchronous call
Spring WebClient is a reactive client that provides an alternative to RestTemplate. It is said that it's asynchronous.
But when i am using normal WebClient without subscribe it working fine but adding subscribe for asynchronous(Non-blocking) not…

Roushan Kumar
- 1
- 3
0
votes
1 answer
Latest Spring Boot [2.5.0] webclient bug?
I have recently upgraded my project to the latest version of spring-boot 2.5.0 and got going with refactoring a ton of deprecated code. I noticed that awaitExchange() has now been deprecated and should be replaced with awaitExchange{it}
However, as…

Maxiepaxie
- 53
- 6
0
votes
0 answers
How to intercept 3xx redirection in Spring WebClient
I am working on a Spring boot project that uses Spring Webclient to do a GET request on a URL which has a 3xx redirection. Using webclient to do the GET request to that url gives 200 response. I would like to stop at the redirection and get a header…

justAnotherDev
- 223
- 1
- 6
- 15
0
votes
1 answer
CustomHostnameVerifier instead of default Hostname Verifier for ssl in Spring Boot Reactor Netty
Using protocol Http2 and trying to disable the hostname verification
But this didn't work for me
return HttpClient.create()
.secure(sslContextSpec ->
…

Cork Kochi
- 1,783
- 6
- 29
- 45
0
votes
1 answer
Spring Boot 2 - WebClient : Call Multiple Rest API's from one Controller
I am using Spring Boot Micro Services and calling downstream to get the data.
The requirement is to get data from more than one downstream and aggregate the responses to a single response.
Could someone help how can I make parallel rest calls within…

Uva
- 752
- 1
- 6
- 10
0
votes
1 answer
How to use webClient in Spring Integration?
I'm trying to use webClient in my Spring Integration application.
Using block() method i got this error:
org.springframework.messaging.MessageHandlingException: error occurred during processing message in 'MethodInvokingMessageProcessor'…

TuGordoBello
- 4,350
- 9
- 52
- 78
0
votes
1 answer
Spring WebClient - How to handle the errors on the body Rest
I'm a newbie with Spring Boot, and I need your help.
I make a GET request with WebClient, and I receive a JSON body as below:
{
"status": "OK",
"error": [],
"payload": {
"name": "John",
"surname": "Doe"
...
}
}
So I…

Marco Buono
- 11
- 4
0
votes
0 answers
Need to understand asynchronous usage of Spring WebClient
I have a doubt regarding the usage of webclient in cirumstances when you need to invoke another service which is slow in responding and then use its data to process something and return in the call to your own api.
e.g. my doSometing method is…

gooner
- 49
- 4
0
votes
0 answers
How to validate error body in Webflux/Webclient
I have a handler method for an endpoint, that is this one:
public Mono create(ServerRequest serverRequest) {
Validator validator = new CreateUserValidator();
Mono userDtoMono =…

AleGallagher
- 1,745
- 7
- 30
- 40
0
votes
0 answers
Testing WebFlux functional routing
I'm trying to figure out how best to test a simple WebFlux passthrough service starting with the routing part.
(the whole small project is available at https://github.com/ChambreNoire/passthru)
I have a simple functional routing setup like this…

ChambreNoire
- 387
- 7
- 19