I am using the graph api:
GET /users/{id | userPrincipalName}/photo/$value
to get the particular user's profile photo with my access token. In postman I am able to see the image using the above get call. In my spring-boot application I am using like below:
final ResponseEntity<Object> profilePicture = restTemplate.exchange(graphUrl, HttpMethod.GET, new HttpEntity<>((header)), new ParameterizedTypeReference<>() {});
I am getting below error:
Could not extract response: no suitable HttpMessageConverter found for response type [class java.lang.Object] and content type [image/jpeg]
I have defined RestTemplate like:
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
Could someone please help me with this?