美文网首页
第六章,rest

第六章,rest

作者: 毛仑上保罗先生 | 来源:发表于2020-01-06 14:50 被阅读0次

什么才是rest架构风格

image.png

是用"api"作为web上下文

http://192.168.0.1/api

增加版本标识

http://192.168.0.1/api/v1.1

标识资源

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

相关文章

网友评论

      本文标题:第六章,rest

      本文链接:https://www.haomeiwen.com/subject/umkkactx.html