title: Content type 'application/json;charset=UTF-8' not supported, when i try send JSON to Spring
body: <p>When i send JSON package from jQuery to Spring RestController i have many errors:</p>
  
  <p>In Spring:</p>
  
  <blockquote>
    <p>Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported]</p>
  </blockquote>
  
  <p>in Chrome:</p>
  
  <blockquote>
    <p>POST <a href="http://localhost/post" rel="nofollow noreferrer">http://localhost/post</a> 415</p>
    
    <p>(anonymous)   @   main.js:11</p>
  </blockquote>
  
  <p>My jQuery code:</p>
  
  <pre><code>$(document).ready(function() {
  
  $('#go').on('click', function() {
  
      var user = {
          "name" : "Tom",
          "age" : 23
      };
  
      $.ajax({
          type: 'POST',
          url: "http://localhost/post",
          contentType: 'application/json; charset=utf-8',
          data: JSON.stringify(user),
          dataType: 'json',
          async: true
      });
  
     });
  
   });
  </code></pre>
  
  <p>My Spring RestController code:</p>
  
  <pre><code>@RestController
  public class mainController {
  @RequestMapping(value = "/post", method = RequestMethod.POST,
          consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
          produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
  public ResponseEntity&lt;Object&gt; postUser(@RequestBody User user){
  System.out.println(user);
  return new ResponseEntity&lt;&gt;("Success", HttpStatus.OK);
  }
  
  @RequestMapping(value = "/get", method = RequestMethod.GET)
  public User getStr(){
      System.out.println("-------------------------");
      return new User("Tom", 56); //'Get' Check
  }
  
  }
  </code></pre>
  
  <p>Entity User:</p>
  
  <pre><code>@Data
  @ToString
  @NoArgsConstructor
  @AllArgsConstructor
  public class User {
    private String name;
    private int age;
  }
  </code></pre>