Versioning REST API

后端 未结 6 1898
迷失自我
迷失自我 2020-12-04 10:23

After having read a lot of material on REST versioning, I am thnking of versioning the calls instead of the API. For example:

http://api.mydomain.com/callfoo         


        
6条回答
  •  佛祖请我去吃肉
    2020-12-04 10:48

    Don't do either of those things, because they push the version into the URI structure, and that's going to have downsides for your client applications. It will make it harder for them to upgrade to take advantage of new features in your application.

    Instead, you should version your media types, not your URIs. This will give you maximum flexibility and evolutionary ability. For more information, see this answer I gave to another question.

提交回复
热议问题