Currently Iâm having an issue with new Spring 5 WebClient and I need some help to sort it out. The issue is: I request some url that returns json response with content type text/html;charset=utf-8. But unfortunately Iâm still getting an exception: org.springframework.web.reactive.function.UnsupportedMedia…
Tag: spring-webflux
Deserializing a list of ints with Spring WebClient
I’m trying to communicate with a Rest service that returns a simple JSON array of ints, e.g. I have the following code to make the call via WebClient: However, Spring returns me an empty Flux. If I replace the bodyToFlux call with a bodyToMono<List<Int>>, then Spring is able to deserialize t…
How to serve files/PDF files the reactive way in spring
I have the following endpoint code to serve PDF files. How can I convert above into a reactive type Flux/Mono and DataBuffer. I have check DataBufferUtils but It doesn’t seem to offer what I needed. I didn’t find any example either. Answer The easiest way to achieve that would be with a Resource. …