Inconsist baseurl behaviour between RestClient and WebClient #32185
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
I migrated some code that uses the declarative http interface support of Spring from
WebClient
toRestClient
as the underlying implementation. Our code started failing on the staging server after that. I managed to trace the problem to a difference in handling of the base url betweenRestClient
andWebClient
.The difference is easily seen via this test program:
Note how the base url does not specify a scheme (
http
orhttps
) in both cases. However, withWebClient
, this is not an issue and the call to the remote service is done. WithRestClient
, an exception is thrown:Maybe it should not have worked in the first place with
WebClient
, I don't know. But maybe it would be good to have the same behaviour?The text was updated successfully, but these errors were encountered: