티스토리 뷰

로깅을 위해 interceptor 에 response.body().string(); 를 걸어놓은것이 문제였다.

 

https://github.com/square/okhttp/issues/1240

 

java.lang.IllegalStateException: closed when trying to access response in onResponse(Response response) · Issue #1240 · square/o

I get java.lang.IllegalStateException: closed at com.squareup.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:455) at okio.Buffer.writeAll(Buffer.java:594) at okio.Re...

github.com

 

를 보면, string() 을 두번 호출하지 말라는것.

 

아마 내부적으로 string() 을 한ㄴ번 호출하나보다. 

 

로그를 찍을때만 활성화 시켜놓고 나머지는 주석처리하자.

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함