在师兄的指导下参考了restful api
实际上是一种设计风格和理念
GET /rest/api/getDogs --> GET /rest/api/dogs
GET /rest/api/addDogs --> POST /rest/api/dogs
GET /rest/api/editDogs/:dog_id --> PUT /rest/api/dogs/:dog_id
GET /rest/api/deleteDogs/:dog_id --> DELETE /rest/api/dogs/:dog_id
在如上的表达中,左边的设计方式暴露了对资源的操作,而右边没有
搭建好接口结构
一、协议
API与用户的通信协议,应总是使用HTTPs协议
二、域名
应该尽量将API部署在专用域名下