Spring RestTemplate post object not not sending in request?

ساخت وبلاگ

Vote count: 0

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.

asked 45 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : spring resttemplate post,spring resttemplate post json,spring resttemplate postforentity,spring resttemplate postforobject,spring resttemplate post with headers example,spring resttemplate post xml,spring resttemplate postforentity example,spring resttemplate post parameters,spring resttemplate post with headers,spring resttemplate post multipart file, نویسنده : استخدام کار backsoft بازدید : 338 تاريخ : دوشنبه 29 شهريور 1395 ساعت: 5:32