//首先导入依赖文件
OkHttp
日志拦截器:
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
OkHttpClient client = new OkHttpClient
.Builder
()
.addInterceptor
(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)) //添加日至拦截器
.build
()
;