Skip to content

Instantly share code, notes, and snippets.

@enginebai
Created August 3, 2020 14:18
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/3e8c77cb805ad79853e1da44518736be to your computer and use it in GitHub Desktop.
Save enginebai/3e8c77cb805ad79853e1da44518736be to your computer and use it in GitHub Desktop.
MovieHunt blog part2. okhttp
val builder = OkHttpClient.Builder()
builder.protocols(listOf(Protocol.HTTP_1_1, Protocol.HTTP_2))
// TODO: set timeout, cache...etc.
val 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