android - How to prepend to the url of the API root in Retrofit / Can I have two Rest Adapters? -


this how set retrofit client.

    restadapter.builder builder = new restadapter.builder();     builder.setendpoint(server.api_root);     builder.setexecutors(executors.newfixedthreadpool(5), new scheduledthreadpoolexecutor(5));     restadapter restadapter = builder.build();     rest_client = restadapter.create(api.class); 

however, of api endpoints i'm using http://example.com/ , others http://test.example.com/ should do?

actually, can have 2 adapters 2 different apis?

you have implement endpoint

sample: https://medium.com/@kevintcoughlin/dynamic-endpoints-with-retrofit-a1f4229f4a8d

if using 2.0 beta+ , endpoint renamed baseurl

also, take @ 2.0+ :

new: @url parameter annotation allows passing complete url endpoint. 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -