title: spring rest return multipart/form-data with application/json content-type
body: <p>I am having problem building a api whose response is multipart/form-data with application/json content</p>
  
  <p>example:</p>
  
  <pre><code>http://localhost:8080/getData 
  </code></pre>
  
  <p>should return</p>
  
  <pre><code>--HaRZrgSMRFElYDqkcBMfTMp3BUMHKQAtP
  Content-Disposition: form-data; name="response"
  Content-Type: application/json
  
  [{"name":"xyz"}]
  --HaRZrgSMRFElYDqkcBMfTMp3BUMHKQAtP--
  </code></pre>
  
  <p>the current code snippet is </p>
  
  <pre><code>@RequestMapping(value="/getData", method=RequestMethod.GET, 
  produces=MediaType.MULTIPART_FORM_DATA_VALUE)
  public MultipartFile getMultipartAsFileAsObject() throws Exception {
      ClassLoader classLoader = getClass().getClassLoader();
      File file = new File(classLoader.getResource("sample.json").getFile());
      String readFile = readFile("sample.json");
      DiskFileItem fileItem = new DiskFileItem("file", "application/json", false, "response", (int) file.length() , file);
      fileItem.getOutputStream();
      MultipartFile multipartFile = new CommonsMultipartFile(fileItem);
      return multipartFile;   
  }
  </code></pre>
  
  <p>and the response i am getting is 
      {} an empty json object.
  can someone let me know where i am going wrong</p>