Okhttp: Reading HTTP Response When Request Isn't Fully Sent

Created on 30 Nov 2018  路  6Comments  路  Source: square/okhttp

If I send a large POST request using OkHttp, but the server responds quickly with an error (e.g. permission denied) I get a

java.net.SocketException: Broken pipe (Write failed)( status = 272 )

exception.

Command line tools like curl seem to handle this case just fine and are able to return the HTTP Response instead of aborting because the write failed. Can okhttp do the same?

Note: also asked here https://stackoverflow.com/questions/53451467/reading-http-response-when-request-isnt-fully-sent.

enhancement

Most helpful comment

All 6 comments

Tough one. I鈥檓 not sure.

I have the same problem, still don't know how to get the response

Won't fix.

Won't fix.

Why? It confuses me.

Was this page helpful?
0 / 5 - 0 ratings