什么是Restful api

一直现代的API接口设计理念

  • 传统API:一个URL是一个功能

  • Restful:一个URL是唯一的资源

  • Restful api尽量不用URL参数

  • Restful api通过method区分具体功能

示例:

传统API

/news/list?page=2

Restful api

/news/list/2

results matching ""

    No results matching ""