When I make my request with only Volley everything goes well and my StringRequest goes to onResponse.
But when I switch to Volley + Okhttp combination, my request goes through, I receive the same response as before but then I get the following error message:
E/Volley﹕ [122319] BasicNetwork.performRequest: Unexpected response code 200 for <my request url>
java.io.IOException: closed
com.android.volley.NetworkError: java.io.IOException: closed
at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:182)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:114)
Caused by: java.io.IOException: closed
at okio.RealBufferedSource$1.read(RealBufferedSource.java:345)
at java.io.InputStream.read(InputStream.java:162)
at com.android.volley.toolbox.BasicNetwork.entityToBytes(BasicNetwork.java:254)
at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:130)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:114)
Im using this https://gist.github.com/bryanstern/4e8f1cb5a8e14c202750 for my OkHttpStack for Volley.
I haven't had too much time to investigate but I was running into the same issue when using the emulator connected through a proxy (Charles). For me the problem goes away when I test without a proxy or on device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With