Skip to content

Instantly share code, notes, and snippets.

@mayuroks
Created August 15, 2018 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayuroks/d3c0f9e8e1616815fa5ec9c563214852 to your computer and use it in GitHub Desktop.
Save mayuroks/d3c0f9e8e1616815fa5ec9c563214852 to your computer and use it in GitHub Desktop.
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