RESTful Service Best Practices:

2018-12-11  本文已影响9人  BenjaminCool

服务版本控制: 借助header:Accept 和 header: ContentType 实现

For example, to retrieve a user in JSON format:

version:1

version:2

Now, to retrieve version 2 of that same resource in JSON format:

服务版本控制方法2:直接在uri中添加版本

通过给uri添加版本号的方式,违反了 REST 设计约束, 这种方法不建议,
反对意见认为: uri统一资源标识符, 既然资源没有变, uri也不该变

上一篇 下一篇

猜你喜欢

热点阅读