com.hiczp.bilibili.api.interceptor.AddAppKeyInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bilibili-api Show documentation
Show all versions of bilibili-api Show documentation
Bilibili Android client API library for Kotlin
package com.hiczp.bilibili.api.interceptor;
import com.hiczp.bilibili.api.BilibiliClientProperties;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class AddAppKeyInterceptor implements Interceptor {
private BilibiliClientProperties bilibiliClientDefinition;
public AddAppKeyInterceptor(BilibiliClientProperties bilibiliClientDefinition) {
this.bilibiliClientDefinition = bilibiliClientDefinition;
}
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
return chain.proceed(request.newBuilder().url(
request.url().newBuilder()
.addQueryParameter("appkey", bilibiliClientDefinition.getAppKey())
.build()
).build());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy