public class Logger implements Interceptor{
@Override
public Response intercept(Chain chain) throws IOException {
Request original = chain.request();
HttpUrl url=original.url().newBuilder()
.addQueryParameter("source","android")
.build();
//添加请求头
Request request = original.newBuilder()
.url(url)
.build();
return chain.proceed(request);
}
}
Android_拦截器请求头
最新推荐文章于 2022-01-26 11:30:01 发布