RequestMapping
RequestMapping中的method方法
method:指定請求的method類型, GET、POST、PUT、DELETE等;
GetMapping
看一下注解的底層源碼
可以看到底層用了@RequestMapping(method = RequestMethod.GET)注解
限制了接收到請求的method類型,相當於是組合注解
其中下面的注解原理也是一樣
@PostMapping
@PutMapping
@DeleteMapping
@PatchMapping
@RequestMapping
總結
其他注解和RequestMapping相比就是加了method限制,