Elle Greco
0
Q:

resttemplate authorization basic

restTemplate.exchange (uri, HttpMethod.POST, new HttpEntity<T>(createHeaders(username, password)), clazz);
0
HttpHeaders createHeaders(String username, String password){   return new HttpHeaders() {{         String auth = username + ":" + password;         byte[] encodedAuth = Base64.encodeBase64(             auth.getBytes(Charset.forName("US-ASCII")) );         String authHeader = "Basic " + new String( encodedAuth );         set( "Authorization", authHeader );      }};}
0

New to Communities?

Join the community