title: Spring postForObject returning 400 Bad Request
body: <p>So, i have that method in my Java application:</p>
  
  <pre><code>public String addAppointment(String service_id, String location_id, String start_date, String client_name, String client_phone, String client_email, String note, String session_token)
  {
      Map&lt;String, String&gt; args = new HashMap&lt;String, String&gt;();
  
      args.put("service_id", service_id);
      args.put("location_id", location_id);
      args.put("start_date", start_date);
      args.put("client_name", client_name);
      args.put("client_phone", client_phone);
      args.put("client_email", client_email);
      args.put("note", note);
  
      System.out.println(API_URL + "company/[censored]/appointment/?session_token="+ session_token);
  
      String result = restTemplate.postForObject(API_URL + "company/[censored]/appointment/?session_token="+ session_token, args, String.class);
  
      return result;
  }
  </code></pre>
  
  <p>And i got that warning:</p>
  
  <pre><code>WARNING: POST request for "http://www.setster.com/api/v2/company/[censored]/appointment/?session_token=[censored]" resulted in 400 (Bad Request); invoking error handler
  WARNING: StandardWrapperValve[setster]: PWC1406: Servlet.service() for servlet setster threw exception
  </code></pre>
  
  <p>When i change that line:</p>
  
  <pre><code>String result = restTemplate.postForObject(API_URL + "company/[censored]/appointment/?session_token="+ session_token, args, String.class);
  </code></pre>
  
  <p>for:</p>
  
  <pre><code>String result = restTemplate.getForObject(API_URL + "company/[censored]/appointment/?session_token="+ session_token, String.class, args);
  </code></pre>
  
  <p>I receive a success message from server with the right response. But, the POST URL is fine and works in PHP with CURL with no problems.</p>
  
  <p>So my question is. What i'm doing wrong? There is another options to create a post with <strong>postForObject</strong>?</p>