title: How to Pass custom objects using Spring's REST Template
body: <p>I have a requirement to pass a custom object using RESTTemplate to my REST service.</p>
  
  <pre><code>RestTemplate restTemplate = new RestTemplate();
  MultiValueMap&lt;String, Object&gt; requestMap = new LinkedMultiValueMap&lt;String, Object&gt;();
  ...
  
  requestMap.add("file1", new FileSystemResource(..);
  requestMap.add("Content-Type","text/html");
  requestMap.add("accept", "text/html");
  requestMap.add("myobject",new CustomObject()); // This is not working
  System.out.println("Before Posting Request........");
  restTemplate.postForLocation(url, requestMap);//Posting the data.
  System.out.println("Request has been executed........");
  </code></pre>
  
  <p>I'm not able to add my custom object to MultiValueMap. Request generation is getting failed.</p>
  
  <p>Can someone helps me to find a way for this? I can simply pass a string object without problem.User defined objects makes the problem.</p>
  
  <p>Appreciate any help !!!</p>