springmvc中只接受固定提交内容类型的请求

springmvc中的@RequestMapping注解是用来处理请求地址映射的,如果某个接口我们只接受请求的提交内容类型(Content-Type)为application/json或text/html,那可以用@RequestMapping中的consumes来定义,同样还有个produces是指定返回的内容类型。

原文地址:https://www.cnblogs.com/shamo89/p/7827178.html