Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@enginebai
Created August 4, 2020 01: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 enginebai/d8e24d92b4d1b3636ce1706a6293ab58 to your computer and use it in GitHub Desktop.
Save enginebai/d8e24d92b4d1b3636ce1706a6293ab58 to your computer and use it in GitHub Desktop.
MovieHunt blog part2. okhttp interceptor
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