1

I'm using Spring for Android for some time in my android app and I use Gson for the marshalling/unmarshalling.

I decided to update Spring for Android with the 1.0.0.RC1 version instead of 1.0.0.M1 and now I get a no suitable HttpMessageConverter found when I use RestTemplate.

I found a workaround by adding the GsonHttpMessageConverter to the RestTemplate message converters :

RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(new GsonHttpMessageConverter());

But is there a way to use RestTemplate with json requests without adding the gson message converter manually ?

Thanks.

dst17
  • 11
  • 2
  • Found an answer (https://github.com/excilys/androidannotations/issues/206) : Roy Clarkson said that the RestTemplate default constructor now comes with no MessageConverters, for performance reasons. So no, I can't use RestTemplate without adding a MessageConverter. – dst17 Jun 01 '12 at 10:04

0 Answers0