/**
* service统一接口数据
* Created by WZG on 2016/7/16.
*/publicinterfaceHttpService {@POST("AppFiftyToneGraph/videoLink")
Observable<RetrofitEntity> getAllVedioBy(@Bodyboolean once_no);
}
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
创建一个retrofit对象
//手动创建一个OkHttpClient并设置超时时间
okhttp3.OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.connectTimeout(5, TimeUnit.SECONDS);
Retrofit retrofit = new Retrofit.Builder()
.client(builder.build())
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.baseUrl(HttpManager.BASE_URL)
.build();