title: AJAX POST request to Spring MVC Controller not working
body: <p>I am facing the error:</p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 415
    (Unsupported Media Type)</p>
  </blockquote>
  
  <p>AJAX portion of my code is as follows:</p>
  
  <pre><code>$.ajax({ 
      url: '/authentication/editUser',    
      type: "POST", 
      contentType: "application/json",
      data: JSON.stringify(requestObj), //Stringified JSON Object
  
      success: function(resposeJsonObject) {
         //
      }   
  });
  </code></pre>
  
  <p>And the controller's handler method:</p>
  
  <pre><code>@RequestMapping(value = "/editUser", method = RequestMethod.POST, 
      headers = {"Content-type=application/json"})
  @ResponseBody
  public  EditUserResponse editUserpost(@RequestBody EditUserRequest editUserRequest) {
      System.out.println(editUserRequest);
      return new EditUserResponse();
  }
  </code></pre>
  
  <p>How to resolve the error?</p>