title: Resttemplate Returns 500 Response Message
body: <p>I am trying to make a post request which is supposed to return a json, but for some reason it returns 500 something went wrong.</p>
  <pre><code>'''
  public void templatRequestPayment(String token, String url, String key, String body)
      throws RestClientException, URISyntaxException, IOException {
      URI uri = new URI(url);
      HttpHeaders headers = new HttpHeaders();
      headers.set(&quot;Authorization&quot;, token);
      headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
      headers.set(&quot;key&quot;, key);
  
      HttpEntity&lt;String&gt; entity = new HttpEntity&lt;String&gt;(body, headers);
  
      RestTemplate template = new RestTemplate(getConverter());
      try {
          ResponseEntity&lt;JsonNode&gt; res = template.exchange(uri, HttpMethod.POST, entity,
              JsonNode.class);
          String tok = res.getBody().toString();
          System.out.println(tok);
      } catch (HttpStatusCodeException e) {
          ResponseEntity&lt;String&gt; st = 
   ResponseEntity.status(e.getStatusCode()).headers(e.getResponseHeaders())
              .body(e.getResponseBodyAsString());
          System.out.println(st.getHeaders() + &quot;-- /n&quot; + st.getBody());
      }
  
  }
  
  protected List&lt;HttpMessageConverter&lt; ?&gt;&gt; getConverter() {
      List&lt;HttpMessageConverter&lt; ?&gt;&gt; converters = Lists.newArrayList();
      converters.add(new MappingJackson2HttpMessageConverter());
      return converters;
  }
  </code></pre>
  <p>'''</p>