Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
具体来说,如果我有一组服务器都公开相同的 REST api,那么在 RetroFit 中是否有一种方法可以指定该组服务器,或者是实例化多个改造客户端并循环访问它们的唯一选项?
该类Server已经可以通过子类化和更改您返回的内容来支持这一点getUrl()。我们以这种方式设计它是为了这个明确的目的。
Server
getUrl()
在此处查看更多讨论:https ://github.com/square/retrofit/issues/385