The 415 (Unsupported media type) error is always returned when data is passed from the page to the background via Ajax, and the data is not available in the background. As shown in the following:
In trying to solve this problem, we first have to understand the concept:
, first we want to guarantee the transmission of the Content-type:application/json charst= "Utf-8
The second arrow in the transmitted JSON string indicates the form, not a pile of letters.
By specifying Content-type in Ajax and Json.stringify () to data, you can then check the header to see if it is correct.
Which, in terms of configuration, such as
Note that the code of the red arrow indicates that the code is usually directly behind the scan controller package. The meaning of a literal understanding is the annotation drive of MVC.Summarize:
You need to consider the JSON format for the transfer and Jackson's version and configuration issues.
Transfer JSON data through Ajax and spring background