title: Post Json Array in Json Object via RestTemplate in Spring Boot
body: <p>Im trying to post an array in a json object using RestTemplate</p>
  
  <pre><code>{
    "update": {
      "name": "xyz",
      "id": "C2",
      "Description": "aaaaaa",
      "members": ["abc", "xyz"]
    }
  }
  </code></pre>
  
  <p>Here is my PostMapping Controller</p>
  
  <pre><code>@PostMapping(value = "/update")
  public Update update(@RequestBody Update update) {
      String url = "";
      HttpHeaders headers = createHttpHeaders("username", "passowrd");
      JSONObject jsonObject = new JSONObject();
      jsonObject.put("update", update);
      HttpEntity&lt;JSONObject&gt; request = new HttpEntity&lt;&gt;(jsonObject, headers);
      ResponseEntity&lt;Update&gt; update = restTemplate.exchange(url, HttpMethod.POST,request, Update.class);
  
      return update.getBody();
  }
  </code></pre>
  
  <p>And this my POJO</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Update {
      private String name;
      private String id;
      private String Descripion;
      private List&lt;String&gt; members;
  }
  </code></pre>
  
  <p>And Im getting 500 </p>
  
  <pre><code>{
    "timestamp": "2020-03-13T06:31:21.822+0000",
    "status": 500,
    "error": "Internal Server Error",
    "message": "No HttpMessageConverter for org.json.JSONObject and content type \"application/json\""
  }
  </code></pre>