Created
September 25, 2016 06:23
-
-
Save vincent-paing/3aa402c0389f2882255fd87330689b25 to your computer and use it in GitHub Desktop.
Rerofit Adapter Static Factory Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Retrofit getRetrofit() { | |
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); | |
interceptor.setLevel(HttpLoggingInterceptor.Level.BASIC); | |
OkHttpClient client = new OkHttpClient.Builder() | |
.addInterceptor(interceptor) | |
.build(); | |
return new Retrofit.Builder().baseUrl(BASE_URL) | |
.client(client) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment