Answer the question
In order to leave comments, you need to log in
What is the correct way to use Retrofit when there are multiple data sources?
For each, I created a separate instance of Retrofit, maybe different headers, interceptors, etc. Now there are a couple more. How to make adding easier? Producing Retrofits is somehow wrong
Answer the question
In order to leave comments, you need to log in
You need to set up the builder and reuse it, each time creating new retrofit instances for different URLs from one builder.
Each of your data sources has its own base URL. Each source has its own API. Naturally, you will have to describe the interfaces for each of these APIs and create a separate Retrofit object for each base URL.
There is absolutely nothing wrong here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question