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.
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.
For anyone struggling with this issue, we did end up getting it to work using Jetty and HTTP 2.0: https://github.com/GoogleCloudPlatform/healthcare-dicom-dicomweb-adapter/blob/master/dicom_util/src/main/java/com/google/cloud/healthcare/DicomWebClientJetty.java#L65
Most helpful comment
For anyone struggling with this issue, we did end up getting it to work using Jetty and HTTP 2.0: https://github.com/GoogleCloudPlatform/healthcare-dicom-dicomweb-adapter/blob/master/dicom_util/src/main/java/com/google/cloud/healthcare/DicomWebClientJetty.java#L65