Git Product home page Git Product logo

rxhttp's Introduction

rxhttp's People

Contributors

liujingxing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rxhttp's Issues

设置公共参数问题

简单看了下您的代码,设置公共参数时是覆盖上一次的设置的,能不能增加一个api,改为追加上一次的设置

上传进度超过100%问题

你好,感谢你的RxHttp,很方便,也可以让我们学习到一些RxJava的知识。
这里有个问题,项目里面测试阶段会给OkhttpClient的log打印出来,

        HttpLoggingInterceptor loggingInterceptor = null;
        if (loggingInterceptor == null) {
            loggingInterceptor = new HttpLoggingInterceptor();
            if (Debug.isDebug) {
                //开发模式记录整个body,否则只记录基本信息如返回200,http协议版本等
                loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            } else {
                loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BASIC);
            }
        }

        new OkHttpClient.Builder().addInterceptor(loggingInterceptor);

这个时候会有两次向 okhttp3.RequestBody 中写入数据,会导致进度超过100%。

虽然这个问题不是 RxHttp 的问题,但是如果能兼容下就棒棒哒!

写在这里也希望其他使用 RxHttp 的人可以看到,不用盲目撞墙。

请问怎么使用链式请求?

如题。
即想要几个请求按顺序完成,例如第一个请求里有一个结果参数会在第二个请求里使用到。
又或者一个页面有好几个接口,需要按顺序请求一遍。

demo会抛异常

W/Choreographer: OPTS_INPUT: First frame was drawed before optimized, so skip!
W/System.err: java.net.SocketException: Socket closed
W/System.err: at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
W/System.err: at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
W/System.err: at okio.RealBufferedSource.read(RealBufferedSource.java:51)
W/System.err: at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okio.ForwardingSource.read(ForwardingSource.java:35)
at rxhttp.wrapper.progress.ProgressResponseBody$1.read(ProgressResponseBody.java:86)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
W/System.err: at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
E/RxHttp: java.net.SocketException: Socket closed

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258049386

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
D/RxHttp: <------------------- request start Method=GET ------------------->

http://s9.pstatp.com/package/apk/aweme/app_aweGW_v6.6.0_2905d5c.apk?versionName=1.0.0&time=1577258055142

RANGE: bytes=0-
deviceType: android

W/System.err: rxhttp.wrapper.exception.HttpStatusCodeException: Method=GET Code=404
W/System.err: message = Not Found
http://s9.pstatp.com/package/apk/aweme/app_aweGW_v6.6.0_2905d5c.apk?versionName=1.0.0&time=1577258055142
Date: Wed, 25 Dec 2019 07:14:16 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive
W/System.err: Server: nginx
Vary: Accept-Encoding
Vary: Accept-Encoding
server-timing: inner; dur=100
X-Ser: BC178_dx-lt-yd-jiangsu-zhenjiang-3-cache-4, BC10_dx-hainan-haikou-5-cache-4
X-Cache: MISS from BC10_dx-hainan-haikou-5-cache-4(baishan)

<title>404 Not Found</title>

404 Not Found


W/System.err:
nginx/1.9.10


W/System.err: at rxhttp.wrapper.exception.ExceptionHelper.throwIfFatal(ExceptionHelper.java:29)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:36)
at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:764)
E/RxHttp: rxhttp.wrapper.exception.HttpStatusCodeException: Method=GET Code=404
message = Not Found

http://s9.pstatp.com/package/apk/aweme/app_aweGW_v6.6.0_2905d5c.apk?versionName=1.0.0&time=1577258055142

Date: Wed, 25 Dec 2019 07:14:16 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive
Server: nginx
Vary: Accept-Encoding
Vary: Accept-Encoding
server-timing: inner; dur=100
X-Ser: BC178_dx-lt-yd-jiangsu-zhenjiang-3-cache-4, BC10_dx-hainan-haikou-5-cache-4
X-Cache: MISS from BC10_dx-hainan-haikou-5-cache-4(baishan)

<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.9.10</center>
</body>
</html>

D/RxHttp: <------------------- request start Method=GET ------------------->

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258056820

RANGE: bytes=0-
deviceType: android

W/System.err: okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL
W/System.err: at okhttp3.internal.http2.Http2Stream$FramingSource.read(Http2Stream.java:384)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okio.ForwardingSource.read(ForwardingSource.java:35)
at rxhttp.wrapper.progress.ProgressResponseBody$1.read(ProgressResponseBody.java:86)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
W/System.err: at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
E/RxHttp: okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL

https://apk-ssl.tancdn.com/3.5.3_276/探探.apk?versionName=1.0.0&time=1577258050199

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL
I/RxHttp: <------------------- request end Method=GET Code=206 ------------------->(583ms)

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258056820

Date: Wed, 25 Dec 2019 07:14:17 GMT
Content-Type: application/vnd.android.package-archive
Content-Length: 45419415
Connection: keep-alive
ETag: "637429375"
Accept-Ranges: bytes
Last-Modified: Mon, 02 Sep 2019 02:39:03 GMT
Server: WS CDN Server
Content-Range: bytes 0-45419414/45419415
Age: 432372
X-Via: 1.1 PS-000-0102761:3 (Cdn Cache Server V2.0)[27 200 0], 1.1 PS-000-01QNz36:0 (Cdn Cache Server V2.0)[47 200 0]

/storage/emulated/0/Android/data/com.example.rxhttp/cache/4.apk

W/Choreographer: OPTS_INPUT: First frame was drawed before optimized, so skip!
W/Choreographer: OPTS_INPUT: First frame was drawed before optimized, so skip!
W/Choreographer: OPTS_INPUT: First frame was drawed before optimized, so skip!
D/RxHttp: <------------------- request start Method=GET ------------------->

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258063385

RANGE: bytes=1075316-
deviceType: android

I/RxHttp: <------------------- request end Method=GET Code=206 ------------------->(346ms)

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258063385

Date: Wed, 25 Dec 2019 07:14:24 GMT
Content-Type: application/vnd.android.package-archive
Content-Length: 44344099
Connection: keep-alive
ETag: "637429375"
Accept-Ranges: bytes
Last-Modified: Mon, 02 Sep 2019 02:39:03 GMT
Server: WS CDN Server
Content-Range: bytes 1075316-45419414/45419415
Age: 432378
X-Via: 1.1 PS-000-0102761:3 (Cdn Cache Server V2.0)[27 200 0], 1.1 PS-000-01QNz36:0 (Cdn Cache Server V2.0)[0 200 0]

/storage/emulated/0/Android/data/com.example.rxhttp/cache/0.apk

W/System.err: java.net.SocketException: Socket closed
W/System.err: at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at okio.Okio$2.read(Okio.java:140)
W/System.err: at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okio.ForwardingSource.read(ForwardingSource.java:35)
W/System.err: at rxhttp.wrapper.progress.ProgressResponseBody$1.read(ProgressResponseBody.java:86)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
at io.reactivex.Observable.subscribe(Observable.java:12267)
W/System.err: at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
W/System.err: java.net.SocketException: Socket closed
E/RxHttp: java.net.SocketException: Socket closed

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258056820

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_read(Native Method)
W/System.err: at com.android.org.conscrypt.NativeSsl.read(NativeSsl.java:399)
at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:546)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
W/System.err: at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okio.ForwardingSource.read(ForwardingSource.java:35)
at rxhttp.wrapper.progress.ProgressResponseBody$1.read(ProgressResponseBody.java:86)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
W/System.err: at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
W/System.err: java.net.SocketException: Socket closed
W/System.err: at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okio.ForwardingSource.read(ForwardingSource.java:35)
at rxhttp.wrapper.progress.ProgressResponseBody$1.read(ProgressResponseBody.java:86)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
W/System.err: at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
E/RxHttp: java.net.SocketException: Socket closed

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258063385

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
E/RxHttp: java.net.SocketException: Socket closed

https://o8g2z2sa4.qnssl.com/android/momo_8.18.5_c1.apk?versionName=1.0.0&time=1577258050949

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
W/Choreographer: OPTS_INPUT: First frame was drawed before optimized, so skip!
W/InputTransport: Slow Input: 119ms so far, channel 'ClientState{24834ca uid 10314 pid 15215} (server)' publisher ~ publishKeyEvent: seq=1, deviceId=-1, source=0x101, action=0x0, flags=0x8, keyCode=4, scanCode=0, metaState=0x0, repeatCount=0,downTime=30690986000000, eventTime=30690986000000
W/InputTransport: Slow Input: 146ms so far, channel 'ClientState{24834ca uid 10314 pid 15215} (server)' publisher ~ publishKeyEvent: seq=2, deviceId=-1, source=0x101, action=0x1, flags=0x8, keyCode=4, scanCode=0, metaState=0x0, repeatCount=0,downTime=30690986000000, eventTime=30690986000000
W/Choreographer: OPTS_INPUT: First frame was drawed before optimized, so skip!
W/Choreographer: OPTS_INPUT: First frame was drawed before optimized, so skip!
W/System.err: java.net.SocketException: Socket closed
W/System.err: at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
W/System.err: at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okio.ForwardingSource.read(ForwardingSource.java:35)
W/System.err: at rxhttp.wrapper.progress.ProgressResponseBody$1.read(ProgressResponseBody.java:86)
W/System.err: at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
W/System.err: at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
W/System.err: java.net.SocketException: Socket closed
W/System.err: at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
W/System.err: at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okio.ForwardingSource.read(ForwardingSource.java:35)
at rxhttp.wrapper.progress.ProgressResponseBody$1.read(ProgressResponseBody.java:86)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
W/System.err: at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
W/System.err: at rxhttp.ObservableDownload.subscribeActual(ObservableDownload.java:85)
W/System.err: at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
W/System.err: java.net.SocketException: Socket closed
W/System.err: at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
W/System.err: at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:19)
at rxhttp.ObservableHttp.execute(ObservableHttp.java:116)
at rxhttp.ObservableHttp.subscribeActual(ObservableHttp.java:67)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/System.err: at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
W/System.err: java.net.SocketException: Socket closed
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:51)
at okhttp3.internal.http1.Http1ExchangeCodec$AbstractSource.read(Http1ExchangeCodec.java:385)
at okhttp3.internal.http1.Http1ExchangeCodec$FixedLengthSource.read(Http1ExchangeCodec.java:423)
at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.java:286)
at okio.RealBufferedSource$1.read(RealBufferedSource.java:447)
W/System.err: at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:124)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:112)
at rxhttp.wrapper.utils.IOUtil.write(IOUtil.java:90)
at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:39)
E/RxHttp: java.net.SocketException: Socket closed

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258041863

W/System.err: at rxhttp.wrapper.parse.DownloadParser.onParse(DownloadParser.java:19)
at rxhttp.ObservableHttp.execute(ObservableHttp.java:116)
at rxhttp.ObservableHttp.subscribeActual(ObservableHttp.java:67)
at io.reactivex.Observable.subscribe(Observable.java:12267)
E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
W/System.err: at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
E/RxHttp: java.net.SocketException: Socket closed

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258022632

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
E/RxHttp: java.net.SocketException: Socket closed

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258044725

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
E/RxHttp: java.net.SocketException: Socket closed

http://update.9158.com/miaolive/Miaolive.apk?versionName=1.0.0&time=1577258032205

E/RxJava: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.net.SocketException: Socket closed
Process 15215 terminated.

addHeader

请问博主,是否可以支持全局配置头信息,动态修改头信息。

混淆后报错

java.lang.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to per.goweii.rxhttp.request.base.BaseResponse
    │ 	at per.goweii.rxhttp.request.RxRequest$1.a(Unknown Source:0)

混淆后出现报错。gson混淆规则也都配置了。

##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }

# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

##---------------End: proguard configuration for Gson  ----------

希望能给个解决的思路。目前不知道为啥

请问下,能串联多个请求?

有一个流程,要串联多个http请求,后面一个http请求要根据前面的请求结果来处理,支持这样的吗?就是一次性发起按顺序发起多个http请求?

这个是因为什么报错? 怎么解决?

E/XgStat: io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.io.IOException: Canceled
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
at rxhttp.ObservableHttp.subscribeActual(ObservableHttp.java:63)
at io.reactivex.Observable.subscribe(Observable.java:12267)
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:784)
Caused by: java.io.IOException: Canceled
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at http.log.SimpleInterceptor.intercept(SimpleInterceptor.java:65)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at rxhttp.ObservableHttp.execute(ObservableHttp.java:79)
at rxhttp.ObservableHttp.subscribeActual(ObservableHttp.java:57)
at io.reactivex.Observable.subscribe(Observable.java:12267) 
at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96) 
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578) 
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) 
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
at java.lang.Thread.run(Thread.java:784) 

okhttp请求超时无效

遇到一个偶发问题,使用okhttp在一些偶发情况下,会出现一直在加载中,设置的超时时间没有起作用,是什么问题呢

默认url不相同怎么处理

大佬我想问一下如果我有两个请求, 并且这个两个请求的baseurl不是同一个应该怎么操作呢.

异常

正在请求的时候,点击返回退出界面的时候会报这个错: io.reactivex.exceptions.UndeliverableException:The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with.
请问怎么解决?

RxHttp 类报红

我在阅读这个 demo 项目,rebuild 过,项目可以跑起来,但是代码中仍然报红。

我在自己的项目中依赖 RxHttp 也是找不到这个类。

对此作者有什么建议吗?

微信截图_20190712232315.png

demo运行不起来

刚刚下载的demo,想运行一下。结果发现RxHttp的包没有找到, 看了一下是有依赖的。
后面又在我自己的项目中引用rxhttp,结果也一样,没有找到rxhttp的包。rxlife倒是没问题

添加请求参数时是否可以添加params

添加请求参数时,每个参数都要add,是否可以设置一个params 通过params去add每个参数,最后在请求的时候去add (params),这样更有利于对每个请求做二次封装

个人有两个小需求

  1. 有时我需要两个或两个以上请求才可以得到自己想要的数据,可以使用你的封装么?

  2. 一些异常的统一处理 如: 断网提示, cookie失效, 登录被踢... ...

个人功能

如果我想在请求的时候,页面显示弹窗 请求结束弹窗关闭,并且同一个页面所有请求都结束的时候才关闭弹窗.这个RxLife有可以实现的方法么?

from -> asObject

可以把from加回来么? 我这边数据返回嵌套的不一样 所以用起来不如from方便

内存溢出

下载文件时,会崩溃, 定制机的缓存大小有限制,报错位置是 ProgressResponseBody 的86行 long bytesRead = super.read(sink, byteCount);,内存溢出了, 发现已下载的内容页没有写入本地, 请问, 这个下载是读取整个文件到缓存, 在把缓存写入到本地的吗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.