区别:
@GetMapping是一个组合注解,是@RequestMapping(method = RequestMethod.GET)的缩写。该注解将HTTP Get 映射到 特定的处理方法上。
同理@PostMapping也是一个组合注解,是@RequestMapping(method = RequestMethod.POST)的缩写。注意:@RequestMapping如果没有指定请求方式,将接收Get、Post、Head、Options等所有的请求方式。
Spring 的 @PostMapping 和 @GetMapping 和 @RequestMapping 的区别
最新推荐文章于 2023-12-31 03:58:18 发布