Below code is throwing 500 Internal server error only in server but works in local host. Any input is appreciated.
Controller endpoint:
@ApiOperation(value = "This API gets info from external service")
@PostMapping(value = "/ref-data/info", headers= "Accept=application/json")
public ResponseEntity<String> getMasterMaterialInfo(@RequestBody RequestDTO requestDTO) {
return service.getInfo(requestDTO);
}
Service method:
public ResponseEntity<String> getInfo(RequestDTO requestDTO) {
HttpEntity<RequestDTO> request = new HttpEntity<>(requestDTO);
String requestUrl = refDataUrl+"?apikey="+apikey;
return restTemplate.exchange(requestUrl, HttpMethod.POST, request, String.class);
}
Server Log: