QiYongchuan / MyGitBlog

个人博客主页,记录计算机学习,前端-后端-全栈学习ing
15 stars 0 forks source link

SpringBoot学习笔记:RESTful应用接口 #92

Open QiYongchuan opened 3 months ago

QiYongchuan commented 3 months ago

什么是RESTful?

REST(Representational State Transfer)是一组设计原则,用于构建网络服务。RESTful服务意味着遵循这些设计原则的服务。

image image

image image image

QiYongchuan commented 3 months ago

SpringBoot 实现RESTful API

image image

动态参数的获取

image

注意:两种类型的参数, 一种是通过url传过来的(比如用户的id),此时需要动态参数的获取,即使用@PathVariable获取到参数 比如获取(get) 和删除(delete)的应用场景 一种则直接通过body请求体传过来的数据, 此时直接通过实体类接受了 比如添加用户,更新用户。

image