springboot在测试连接数据时,提示错误:Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method ‘GET’ not supported]
意思是不支持get方法。也就是说当前方法是post类型,而我们用一个get连接请求了这个方法,当然会报错。
大概率是方法前的注解类型写错了
将@PostMapping
改为 @GetMapping
或者@RequestMapping
即可。
SpringBoot提示错误:HttpRequestMethodNotSupportedException: Request method ‘GET‘ not supported
最新推荐文章于 2025-03-27 14:07:21 发布