美文网首页
2.2 服务版本化

2.2 服务版本化

作者: spbreak | 来源:发表于2016-02-23 16:28 被阅读13次

根据不同的需求(版本/机型/活动), 返回不同的数据

版本化系统的结构主要有两种方式: 

主动系统: 运程门面会接收到客户端的当前版本, 然后选择正确的端点

被动系统: 版本化服务端点是硬编码到客户端的每个新发布中

两种版本输入方式

// a version given in the URL structure
http://example.com/api/1.0/stockquote/AAPL

// a version given as a query parameter
http://example.com/api/stockQuote.php?ticker=AAPL&apiVersion=1.0

相关文章

网友评论

      本文标题:2.2 服务版本化

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