注解使用中 @RequestMapping 和 @GetMapping @PostMapping 区别

  • @GetMapping是一个组合注解,是@RequestMapping(method = RequestMethod.GET)的缩写。
  • @PostMapping是一个组合注解,是@RequestMapping(method = RequestMethod.POST)的缩写。
  •  @RequestMapping是一个用来处理请求地址映射的注解,可用于类或方法上。用于类上,表示类中的所有响应请求的方法都是以该地址作为父路径。

 

posted @ 2019-05-28 14:42  Just_Elyon  阅读(4934)  评论(0编辑  收藏  举报