package com.bwie.a11861.shizhehao0407.model.utils;
import android.util.Log;
import com.bwie.a11861.shizhehao0407.application.Contacts;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
public class BaseRetrofitHttp {
private Retrofit retrofit;
private BaseRetrofitHttp(){
OkHttpClient okHttpClient=new OkHttpClient.Builder()
.connectTimeout(5,TimeUnit.SECONDS)
.readTimeout(5,TimeUnit.SECONDS)
.addInterceptor(getAddInterceptor())
.build();
retrofit = new Retrofit.Builder()
.baseUrl(Contacts.BASE_URL)
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.addConverterFa
Retrofit+OKHttp网络框架
最新推荐文章于 2024-04-02 08:18:35 发布