@GetMapping
常用的是@RequestMapping,这时默认的是get和post都支持,但也可以根据需求指定
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021051816200993.png)
那么当参数指定为GET时,相当于@GetMapping
@GetMapping("/hello")
public String hello(@RequestParam(value = "name", defaultValue = "man") String name) {
return String.format("Hello %s!", name);
}
同样的还有post、del和put对应的注解
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210518163028535.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021051816333192.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1ODg1NDI5,size_16,color_FFFFFF,t_70)
后续再更新