When I run a WebClient as follows:
WebClient.create(apiUrl)
.get()
.uri(uriBuilder -> uriBuilder
.path("/some/{productId}/")
.queryParam("ws_key", apiKey)
.build(productId)
)
.accept(MediaType.APPLICATION_XML)
.retrieve()
.bodyToMono(MyClass.class)
.block();
The server return the header Content-Type with the value "text/html".
When I use Chrome to make the request, it returns correctly "text/xml" (it is a XML page).
I tried several "accept" parameters, and I am always getting "text/html".
Any idea on the problem? Thanks!