RestTemplate basic or digest Authentication with the current httpclient (4.x)
问题 I'm trying to do Digest mostly (or Basic) Authentication using RestTemplate and httpclient (4.x) . Since I couldn't find any relevant examples of how to actually do this, I have attempted various ways to hook the various httpclient artifacts, with no luck - essentially, no Authentication header is sent at all. My current implementation is: DefaultHttpClient newHttpClient = new DefaultHttpClient(); Credentials credentials = new UsernamePasswordCredentials( username, password ); AuthScope