上QQ阅读APP看书,第一时间看更新
Including the version in the URL
Including the version in the URL is an easy strategy for having the version number added at the end of the URI. Let's see how this is done:
https://api.domain.com/v1/
https://api.domain.com/v2/
https://api.domain.com/v3/
Basically, this model tells the consumers which API version they are using. Every breaking change increases the version number. One issue that may occur when the URI for a resource changes is that the resource may no longer be found with the old URI unless redirects are used.