所以在谷歌上搜索一下,似乎普遍的共识是,在睡觉URI中嵌入版本号是一种糟糕的做法,也是一个糟糕的 idea .
尽管如此,还是有强烈的支持者支持这一点.
例如Best practices for API versioning?
我的问题是关于如何实现提议的解决方案,即使用Django-睡觉框架中的Accept头/内容协商来实现这一点.
It looks like content negotiation in the framework,
http://django-rest-framework.org/api-guide/content-negotiation/
is already configured to automatically return intended values based on accepted MIME types. If I start using the Accept header for custom types, I'll lose this benefit of the framework.
在框架中有没有更好的方法来实现这一点?