参考了网上一些博客后自己总结
做过WEB开发的朋友应该都接触过这个词---REST和RESTful
REST是一种软件架构风格,RESTful就是用了“REST方式的”
REST即表述性状态传递(英文:Representational State Transfer,简称REST)
通俗讲就是,用URL定位资源,用HTTP描述操作的接口风格
增:system.com/aa/friends 接口类型:POST
删:system.com/aa/friends 接口类型:DELETE
改:system.com/aa/friends 接口类型:PUT
查:system.com/aa/friends 接口类型:GET
反例:system.com/aa/deleteFriends 该接口用来表示删除朋友,这就是不符合REST风格
接口的返回值一般是JSON或者其他,我只接触过JSON,其他不是很了解
拥有这套风格的接口,有益于前后端分离,前端负责展示和渲染,后端处理完数据用JSON返回就行了