Created
August 4, 2020 01:34
-
-
Save enginebai/d8e24d92b4d1b3636ce1706a6293ab58 to your computer and use it in GitHub Desktop.
MovieHunt blog part2. okhttp interceptor
This file contains hidden or 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
val builder = OkHttpClient.Builder() | |
builder.addInterceptor(get<HttpLoggingInterceptor>()) | |
builder.addInterceptor(get<ApiInterceptor>()) | |
builder.protocols(listOf(Protocol.HTTP_1_1, Protocol.HTTP_2)) | |
var httpClient = builder.build() | |
Retrofit.Builder() | |
…(略) | |
.client(httpClient) // 加到 Retrofit | |
.build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment