RxJava结合retrofit网络请求

public static ApiService create(int port) {
    if (apiService == null) {
        Retrofit retrofit = new Retrofit.Builder().baseUrl(AppConst.BASE_URL)//+ ":" + port + "/"
                .client(getOkHttpClient())
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create()).build();
        apiService = retrofit.create(ApiService.class);
    }
    return apiService;
}

你可能感兴趣的:(RxJava结合retrofit网络请求)