Set dynamic base url using Retrofit 2.0 and Dagger 2
问题 I\'m trying to perform a login action using Retrofit 2.0 using Dagger 2 Here\'s how I set up Retrofit dependency @Provides @Singleton Retrofit provideRetrofit(Gson gson, OkHttpClient client) { Retrofit retrofit = new Retrofit.Builder() .addConverterFactory(GsonConverterFactory.create(gson) .client(client) .baseUrl(application.getUrl()) .build(); return retrofit; } Here\'s the API interface. interface LoginAPI { @GET(relative_path) Call<Boolean> logMe(); } I have three different base urls