这是很久之前遇到的一个问题,大概是前台传递JSON,后台无法正常接收。

这里记录一下解决方法:

通过consumes 指定处理请求的提交内容类型(Content-Type)。

@PostMapping(value = "/book/set/",consumes = "application/json")

更多推荐

Spring MVC Content type 'application/x-www-form-urlencoded' not suppor