EasyHttp
概述
基于RxJava2+Retrofit2+RxCache的网络请求框架
更新日志
2017.04.28
onError(int code, String errorMsg)非网络问题不再统一返回1003,而是返回服务器的错误状态码 。
2017.04.26
使用RxCache缓存机制,可自定义缓存过期时间,及数据分页缓存等功能。
统一的请求错误处理;
统一的网络状态判断处理;
基于HttpLoggingInterceptor的请求日志打印。
使用说明
####1 引入插件
//Rxjava2
compile 'io.reactivex.rxjava2:rxjava:2.0.7'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
//Retrofit2
compile 'com.squareup.retrofit2:retrofit:latest.release'
compile 'com.squareup.retrofit2:converter-gson:latest.release'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
//RxCache
compile "com.github.VictorAlbertos.RxCache:runtime:1.8.0-2.x"
compile 'com.github.VictorAlbertos.Jolyglot:gson:0