Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class HttpClient {
private static final String API_BASE_URL = "https://jsonplaceholder.typicode.com/";
private static Retrofit retrofit = new Retrofit.Builder()
.baseUrl(API_BASE_URL)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.build();
private static ApiService apiService = retrofit.create(ApiService.class);
public static ApiService getApiService() {
return apiService;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment