Skip to main content
Fix code formatting.
Source Link
Pang
  • 10.2k
  • 146
  • 87
  • 126
HttpHeaders headers = new HttpHeaders(); headers.setBasicAuth(username, password); 
HttpHeaders headers = new HttpHeaders(); headers.setBasicAuth(username, password); 

then continue with the same procedure mentioned by the others here:

HttpEntity<String> request = new HttpEntity<String>(headers); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, request, String.class); 
HttpEntity<String> request = new HttpEntity<String>(headers); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, request, String.class); 
HttpHeaders headers = new HttpHeaders(); headers.setBasicAuth(username, password); 

then continue with the same procedure mentioned by the others here:

HttpEntity<String> request = new HttpEntity<String>(headers); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, request, String.class); 
HttpHeaders headers = new HttpHeaders(); headers.setBasicAuth(username, password); 

then continue with the same procedure mentioned by the others here:

HttpEntity<String> request = new HttpEntity<String>(headers); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, request, String.class); 
Source Link
Its-Saab
  • 266
  • 3
  • 5

HttpHeaders headers = new HttpHeaders(); headers.setBasicAuth(username, password); 

then continue with the same procedure mentioned by the others here:

HttpEntity<String> request = new HttpEntity<String>(headers); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, request, String.class);