// RestClient.Builder builder = ...; // RestClient client = builder.requestInterceptor( // new BasicAuthenticationInterceptor("admin", "password123")).build(); // client.get().uri(baseUrl + "/api/hello").retrieve().body(String.class); Response: Hello, you have accessed a secured endpoint!