-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RxHttp 3.0 更新指南,升级必看 #448
Comments
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1、默认
OkHttpClient
更改在3.0版本之前,默认支持自签名的https,配置如下:
3.0版本则取消对自签名https的默认支持,更改后的如下:
所以,如果你之前没有自定义
OkHttpClient
对象,且需要支持没有证书的https网站,则需要自定义OkHttpClient
对象,如下:2、缓存功能相关类目录更改
目前由之前的
rxhttp.wrapper.cahce
改为rxhttp.wrapper.cache
,如有用到,重新导入即可3、
asXxx/toXxx/toFlowXxx
方法更改RxJava环境的
asXxx
方法改为了toObserableXxx
Await环境的
toXxx
系列方法改为toAwaitXxx
方法Flow环境仅更改了下载系列方法,由
toFlow
改为toDownloadFlow
以上详细更改,请查看3.0 toObserableXxx/toAwait/toFlowxxx方法介绍
4、setOnParamAssembly公共参数回调更改
5、RxJava上传进度监听方式更改
6、RxJava/Await/Flow下载方法更改
对于
Await/Flow
下载,仅仅是更改了方法名,由3.0前的toDownload/toFlow
改为了toDownloadAwait/toDownloadFlow
;而
RxJava
,不仅更改了方法名,还调整了下载进度监听方式,跟监听上传进度一样,如下:7、RxJava同步请求方法setSync更改
8、获取Bitmap/Headers/OkHttp3.Response对象方式更改
删除RxJava下的
asBitmap/asHeaders()/asOkResponse
方法删除Await下的
toBitmap/toHeaders()/toOkResponse
方法删除Flow下的
toFlowBitmap/toFlowHeaders()/toFlowOkResponse
方法The text was updated successfully, but these errors were encountered: