小编jes*_*aul的帖子

How to Change API Base Url at Runtime(Retrofit,Android,Java)?

I need to change base url at run time. I have login button and when login button click time i am called my login api like below :

login api = http://192.168.0.61/api/authenticate

API_BASE_URL = http://192.168.0.61/api/

when i get success response from first api i get client server url for changing baseUrl.

CompanyUrlConfigEntity companyUrlConfigEntity = response.body(); like below :

String clientUrl = companyUrlConfigEntity. getBaseUrl();

                            clientUrl = http://192.168.0.238/api/
Run Code Online (Sandbox Code Playgroud)

In this project mainly for client or company based.So they have their own server. …

java rest android retrofit2

5
推荐指数
1
解决办法
5893
查看次数

标签 统计

android ×1

java ×1

rest ×1

retrofit2 ×1