什么才是rest架构风格
image.png
是用"api"作为web上下文
增加版本标识
标识资源
http://192.168.0.1/api/v1.1/system/user
其实也就是我们平时所说的接口路径
确定http method (访问方式)
image.png
确定http status(也就是我们平时返回的code)
image.png
其实没有这种方式我们一样可以实现我们的需求,平时的get,post就ok了, 但是rest是一种轻量级的架构方式, 所以目前来说也是比较受欢迎的,下面看看我们如何在springboot中是用这种方式
image.png
image.png
image.png













网友评论