您的位置:首页 > 其它

自定义拦截器

2018-08-25 07:34 72 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/wanglin1314521/article/details/82047670
[code]OkHttpClient okHttpClient = new OKHttpClient.Buider().addInterceptor(new MyInterceptor()).build();

class MyInterceptor implements Interceptor{

public Response intercept(Chain chain) throws IOException{
Request request =chain.request();
Request newRequest =request.newBuider.addHeader("source",android).build();
Request response =chain.proceed(newRequest);
return response;

}

}

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: