Created
July 19, 2018 18:15
-
-
Save dinorahtovar/ca9fe69dda5779b9be5b529f43aed035 to your computer and use it in GitHub Desktop.
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
/** | |
* OkHttpClient | |
*/ | |
@Provides | |
@Singleton | |
fun getUnsafeOkHttpClient(): OkHttpClient { | |
val interceptor = HttpLoggingInterceptor() | |
interceptor.level = HttpLoggingInterceptor.Level.HEADERS | |
interceptor.level = HttpLoggingInterceptor.Level.BODY | |
val builder = OkHttpClient.Builder() | |
builder.addInterceptor(interceptor) | |
.connectTimeout(20, TimeUnit.SECONDS) | |
.readTimeout(20, TimeUnit.SECONDS) | |
.addInterceptor(SupportInterceptor()) | |
.authenticator(SupportInterceptor()) | |
return builder.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment