OkHtttp拦截器

来源:互联网 发布:兴达驾校网络预约系统 编辑:程序博客网 时间:2024/06/05 00:59
public class MyLogInterceptor implements Interceptor {    @Override    public Response intercept(Chain chain) throws IOException {        Request request = chain.request().newBuilder()                .header("shenfen", "chinesse")                .build();        HttpUrl url = request.url();        String httpUrl = url.url().toString();        Log.e("TAG", "============" + httpUrl);        Response response = chain.proceed(request);        int code = response.code();        Log.e("TAG", "============response.code() == " + code);        return response;    }}
原创粉丝点击