// RestClient client = builder.build(); // no basic auth // client.get().uri(baseUrl + "/api/hello").retrieve().body(String.class); Thrown: org.springframework.web.client.HttpClientErrorException$Unauthorized Status: 401 UNAUTHORIZED # retrieve() throws HttpClientErrorException on 4xx by default -- same default as # RestTemplate, unlike RestClient's own exchange() method, which disables that default.