diff --git a/src/main/java/io/mosip/mimoto/service/impl/DataShareServiceImpl.java b/src/main/java/io/mosip/mimoto/service/impl/DataShareServiceImpl.java index 3674b387..0cbd1b09 100644 --- a/src/main/java/io/mosip/mimoto/service/impl/DataShareServiceImpl.java +++ b/src/main/java/io/mosip/mimoto/service/impl/DataShareServiceImpl.java @@ -22,6 +22,8 @@ import org.springframework.util.AntPathMatcher; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.PathMatcher; +import org.springframework.http.HttpMethod; +import org.springframework.web.client.RestTemplate; import java.net.URL; @@ -99,7 +101,13 @@ public VCCredentialResponse downloadCredentialFromDataShare(PresentationRequest ErrorConstants.RESOURCE_INVALID.getErrorCode(), ErrorConstants.RESOURCE_INVALID.getErrorMessage()); } - String vcCredentialResponseString = restApiClient.getApi(credentialsResourceUri, String.class); + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.add("Accept", "application/json"); + headers.add("Accept-Charset", "UTF-8"); + + HttpEntity entity = new HttpEntity<>(headers); + String vcCredentialResponseString = restTemplate.exchange(credentialsResourceUri, HttpMethod.GET, entity, String.class).getBody(); if (vcCredentialResponseString == null) { throw new InvalidCredentialResourceException( ErrorConstants.SERVER_UNAVAILABLE.getErrorCode(),