I am consuming a web service using RestTemplate and my POST request is as follows.
RestTemplate requestTemplate = new RestTemplate();
MappingJackson2HttpMessageConverter jsonHttpMessageConverter = new MappingJackson2HttpMessageConverter(); jsonHttpMessageConverter.getObjectMapper().configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); requestTemplate.getMessageConverters().add(jsonHttpMessageConverter);
String uuidResult = requestTemplate.postForObject(url, requestBodyJsonObject , String.class);
I tried printing my requestBodyJsonObject and put it in a rest client, it works fine so no issue with request body. But here I am not getting the expected result and just getting the result when I send a post request without a request body from rest client.
So I am clueless here. Your help would be highly appreciated.