在阅读了很多关于REST版本的材料之后,我正在考虑改用电话而不是API。例如:
http://api.mydomain.com/callfoo/v2.0/param1/param2/param3
http://api.mydomain.com/verifyfoo/v1.0/param1/param2
而不是第一次拥有
http://api.mydomain.com/v1.0/callfoo/param1/param2
http://api.mydomain.com/v1.0/verifyfoo/param1/param2
然后开始
http://api.mydomain.com/v2.0/callfoo/param1/param2/param3
http://api.mydomain.com/v2.0/verifyfoo/param1/param2
我看到的好处是:
- When the calls change, I do not have to rewrite my entire client - only the parts that are affected by the changed calls.
- Those parts of the client that work can continue as is (we have a lot of testing hours invested to ensure both the client and the server sides are stable.)
- I can use permanent or non-permanent redirects for calls that have changed.
- Backward compatibility would be a breeze as I can leave older call versions as is.
我错过什么了吗?