Updated on 2026-08-14

This commit is contained in:
Tangem 2018-10-11 12:39:58 +03:00
parent 6c8c365317
commit 922610a9ed
7 changed files with 50 additions and 163 deletions

View file

@ -47,16 +47,15 @@ class NetworkModule {
.build();
}
private OkHttpClient createHttpClient() {
return new OkHttpClient.Builder().
addInterceptor(createLogging()).
build();
}
private HttpLoggingInterceptor createLogging() {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
return logging;
@Singleton
@Provides
@Named(Server.ApiUpdateVersion.URL_UPDATE_VERSION)
Retrofit provideGithubusercontent() {
return new Retrofit.Builder()
.baseUrl(Server.ApiUpdateVersion.URL_UPDATE_VERSION)
.addConverterFactory(GsonConverterFactory.create())
.client(createHttpClient())
.build();
}
@Singleton
@ -70,4 +69,16 @@ class NetworkModule {
.build();
}
private OkHttpClient createHttpClient() {
return new OkHttpClient.Builder().
addInterceptor(createLogging()).
build();
}
private HttpLoggingInterceptor createLogging() {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
return logging;
}
}