Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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