0

I want to consume an API secured with Digest Auth using REST Template. I am able to do so using ClosableHttpClient.

ClosableHttpClient client = HttpClients.createDefault();
HttpResponse response = client.execute(new HttpGet(uri));

here I get response code 401 with headers and I can use it further.

I want to use RESTTemplate to achieve same but while using rest template it just gives 401 with no headers. I tried debugging it but it simply returns 401 Unauthorized No Body.

SHASHA
  • 90
  • 1
  • 12

0 Answers0