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.UnsupportedMediaTypeException: Content type ‘text/html;charset=utf-8’ not supported. So I canât convert response to DTO. For request I use following code:
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 the response as expected. The drawback being that I have
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. Note that DataBufferUtils has some useful methods