@RequestMapping,@GetMapping ,@PostMapping,@PutMapping,@DeleteMapping请求的用法(推荐)

王文峯的关注图片,淦!

学习目标

1、一周掌握 JAVA入门到进阶知识
2、掌握基础C#l窗体知识
3、手把手教你vbs脚本制作
4、强大的 IDEA编程利器
5、经典少见的 面试题目技巧


@GetMapping ,@PostMapping,@PutMapping,@DeleteMapping请求的用法


前言

在这里插入图片描述


希望:2012新的一年,想要的都拥有,得不到的都释怀!

@PostMapping

如图所示:
在这里插入图片描述

增加应该使用POST

@DeleteMapping

如图所示:
在这里插入图片描述

删除应该使用DELETE

@PutMapping

如图所示:
在这里插入图片描述

修改应该使用PUT

@GetMapping

如图所示:
在这里插入图片描述

查询应该使用GET

@RequestMapping

如图所示:
在这里插入图片描述

@GetMapping是一个组合注解 是@RequestMapping(method = RequestMethod.GET)的缩写
@DeleteMapping是一个组合注解 是@RequestMapping(method = RequestMethod.DELETE)的缩写
@PutMapping是一个组合注解 是@RequestMapping(method = RequestMethod.PUT)的缩写
@PostMapping是一个组合注解 是@RequestMapping(method = RequestMethod.POST)的缩写

总结

通过上面的介绍,我们应该学会了怎么用上述的注解了。

猜你喜欢

转载自blog.csdn.net/Feng_wwf/article/details/112388009