Skip to content

Instantly share code, notes, and snippets.

@enginebai
Created August 3, 2020 14:21
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/a241fe985674921866323ec26f249855 to your computer and use it in GitHub Desktop.
Save enginebai/a241fe985674921866323ec26f249855 to your computer and use it in GitHub Desktop.
MovieHunt blog part2. interceptor
class ApiInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
var request = chain.request()
val url = request.url.newBuilder().addQueryParameter("api_key", BuildConfig.TMDB_API_KEY).build()
request = request.newBuilder().url(url).build()
return chain.proceed(request)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment