For example the first baseurl is "http://aa.aa.com/", Second baseurl is "http://bb.bb.com/", how can i use singleton retrofit to "hot" change base url.
I have the same problem. Hope a request level baseurl api.
The base url can change over time by implementing BaseUrl and returning different values (such as in a round robin or based on data from response headers). You can also specify a full host name in your HTTP annotation or use the @Url annotation on a parameter to allow specifying a full host name dynamically.
This has been my answer until 2.0.0. Why is BaseUrl removed?
Using @Url squashes all the path and query parameters into one, which makes it really inconvenient.
@jianghaolu See #1652
Most helpful comment
This has been my answer until 2.0.0. Why is
BaseUrlremoved?Using
@Urlsquashes all the pathand queryparameters into one, which makes it really inconvenient.