private static void initOkHttpClient() {
if (okHttpClient == null) {
synchronized (RetrofitHelper1.class) {
if (okHttpClient == null) {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
okHttpClient = new OkHttpClient.Builder()
.addInterceptor(interceptor)
.build();
}
}
}
}
注意要添加OKLog的依赖!
network interface log print
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325178745&siteId=291194637
Recommended
Ranking