简体   繁体   中英

How to call multiple endpoints Using retrofit?

When we use reteofit We create a POJO class and one Interface that contains multiple endpoints then we create Retrofit instance to make network call .
If we have a multiple endpoints in an interface then to call them as per user request using single Retrofit Instance .
How can do that can anyone provide the Example.

I'm not sure if I've understood your question correctly. If you want to use the same instance with your endpoints or the same instance of retrofit - you may want to take advantage of singleton pattern or use dagger and put to use @Singleton annotation.

Here you are some tutorial that seems sufficient for starting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM