I/okhttp3.OkHttpClient: Callback failure for call to http://i1.fuimg.com/…
java.io.IOException: closed
at okio.RealBufferedSource$1.read(RealBufferedSource.java:363)
at java.io.InputStream.read(InputStream.java:101)
at com.legendary.administrator.okhttp2.MainActivity
9.
o
n
R
e
s
p
o
n
s
e
(
M
a
i
n
A
c
t
i
v
i
t
y
.
j
a
v
a
:
245
)
a
t
o
k
h
t
t
p
3.
R
e
a
l
C
a
l
l
9.onResponse(MainActivity.java:245) at okhttp3.RealCall
9.onResponse(MainActivity.java:245)atokhttp3.RealCallAsyncCall.execute(RealCall.java:133)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:760)
原因是提前把服务器返回的内容读出来了,后面没法操作了,把Log屏蔽掉ok了
public void onResponse(Call call, Response response) throws IOException {
//Log.e(TAG, “服务器返回:” + response.body().string());