title: Spring RestRemplate postforobject with request parameter having integer value
body: <p>I have a method in  Spring rest service.</p>
  
  <pre><code>@RequestMapping(value = "test/process", method = RequestMethod.POST)
  public @ResponseBody MyResponse processRequest(String RequestId, int count)
  </code></pre>
  
  <p>I am using Spring RestTemplate to call this service like this.</p>
  
  <pre><code>RestTemplate restTemplate = this.getRestTemplate();
  MultiValueMap&lt;String, Object&gt; map = new LinkedMultiValueMap&lt;String, Object&gt;();
  map.add("RequestId", RequestId);
  map.add("count", count); 
  restTemplate.postForObject(url, map,MyResponse.class);
  </code></pre>
  
  <p>When I try to invoke the client method I get the exception that<b> no suitable HttpMessageConverter found for request type [java.lang.Integer]</b></p>
  
  <pre><code>org.springframework.http.converter.HttpMessageNotWritableException: Could not write request: no suitable HttpMessageConverter found for request type [java.lang.Integer]
  at org.springframework.http.converter.FormHttpMessageConverter.writePart(FormHttpMessageConverter.java:310)
  at org.springframework.http.converter.FormHttpMessageConverter.writeParts(FormHttpMessageConverter.java:270)
  at org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(FormHttpMessageConverter.java:260)
  at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:200)
  at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:1)
  at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:596)
  at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:444)
  at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:409)
  at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:287)
  </code></pre>
  
  <p>I know one of the ways is to pass all the parameters as String. But I might need to pass complex data types as parameters later. 
  What is the ways to achieve this.
  I have googled and some option seem to be writing my own converters. How should I start about solving this problem.</p>