okhttpUtils将音频发布为params但抛出java.net.ProtocolException:预期1875字节,但收到2067

时间:2016-11-04 07:32:59

标签: android okhttp okhttp3 protocolexception

这是我的代码,我们将一个音频作为一个参数发送到我的服务器,但有时它会失败,我不知道哪里出错,谁可以帮助我或给我一些建议,谢谢你〜< / p>

     OkHttpUtils.post(postUrl)
                .params("Filedata",new File(GlobalUtils.getRecordDirPath()
                        ,RECORD_TEMP_MP3))
                .execute(new JsonCallback<GradeSpeakingReportModel>(GradeSpeakingReportModel.class) {
                    @Override
                    public void onSuccess(GradeSpeakingReportModel gradeSpeakingReportModel, Call call, Response response) {

                    ....
                    }

                    @Override
                    public void onError(Call call, Response response, Exception e) {
                        super.onError(call, response, e);
                        ....

                    }
                });
    }

的 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:java.net.ProtocolException:预期1875字节但收到2067 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.Http1xStream $ FixedLengthSink.write(Http1xStream.java:279) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okio.RealBufferedSink.flush(RealBufferedSink.java:216) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okio.ForwardingSink.flush(ForwardingSink.java:39) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okio.RealBufferedSink.flush(RealBufferedSink.java:218) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at com.lzy.okhttputils.request.ProgressRequestBody.writeTo(ProgressRequestBody.java:61) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:47) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) 11-04 15:14:03.250 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at com.lzy.okhttputils.interceptor.LoggerInterceptor.intercept(LoggerInterceptor.java:40) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.RealCall.access $ 100(RealCall.java:33) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.RealCall $ AsyncCall.execute(RealCall.java:120) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at java.lang.Thread.run(Thread.java:841) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:java.net.ProtocolException:预期1875字节但收到2067 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.Http1xStream $ FixedLengthSink.write(Http1xStream.java:279) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okio.RealBufferedSink.flush(RealBufferedSink.java:216) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okio.ForwardingSink.flush(ForwardingSink.java:39) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okio.RealBufferedSink.flush(RealBufferedSink.java:218) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at com.lzy.okhttputils.request.ProgressRequestBody.writeTo(ProgressRequestBody.java:61) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:47) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.255 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at com.lzy.okhttputils.interceptor.LoggerInterceptor.intercept(LoggerInterceptor.java:40) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.RealCall.access $ 100(RealCall.java:33) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.RealCall $ AsyncCall.execute(RealCall.java:120) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587) 11-04 15:14:03.260 21739-21739 / com.smartstudy.smartmark W / System.err:at java.lang.Thread.run(Thread.java:841) 11-04 15:14:11.930 21739-21739 / com.smartstudy.smartmark D / dalvikvm:GC_FOR_ALLOC释放4955K,36%免费42107K / 65148K,暂停56ms,总计56ms

0 个答案:

没有答案