I'm trying to update the WSO2 challenge questions given the users email by calling the rest api endpoint using RestTemplate:

String url = baseUrl + email + "/challenge-questions";
HttpEntity<Payload> request = new HttpEntity<Payload>(payload, headers);

try{
  ResponseEntity response = restTemplate.exchange(url, HttpMethod.PUT, request, String.class);
} catch(Exception e){
  LOG.error(e);
}

Does anyone else get the following error even after providing the authorization token in the headers:

org.springframework.web.client.HttpClientErrorExeption$Unauthorized: 401 :[no body]

If so, how can I resolve this issue?

0

There are 0 best solutions below