查看拦截okhttp发出的请求
1、build.gradle
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.4'
2、添加拦截
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
//builder.addNetworkInterceptor(new StethoInitInterceptor(context));
// 同时添加了,OkHttpProfilerInterceptor这个就看不到了
builder.addInterceptor(new OkHttpProfilerInterceptor());
}
OkHttpClient client = builder.build();
3、android studio 安装插件
OkHttp Profiler


网友评论