@RequestMapping,如果不配置 method, 则以任何请求形式 RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE 等都可以访问得到

@RequestMapping(value = "/userInfo", method = {RequestMethod.POST,RequestMethod.GET})

一般指定具体的 method,方便在 swagger-ui.html 进行调试。

原文地址:https://www.cnblogs.com/cag2050/p/12401367.html