-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading HTTP Response When Request Isn't Fully Sent #4425
Comments
Tough one. I’m not sure. |
I have the same problem, still don't know how to get the response |
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 |
Related: #6121 |
@swankjesse I have been testing the latest alpha-release and was happy to see early server responses handled much better than before! The fix works great when the server decides to end the exchange early. However, i have another use-case where the request body source stream might fail client-side during transmission. In this case, an exception is thrown because of:
even if we actually did manage to partially send the request. It would be nice to still be able to get the server response code (typically 4xx/5xx) + headers/trailers in this case. I started sketching on a way to fix this: master...jan-berge-ommedal:partial_requests Could something like this be fitted into okhttp? |
@jan-berge-ommedal rather than comment on this issue, why not put up a proper PR with the current diff to work through. |
PR up @yschimke, sorry for the late response |
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.
The text was updated successfully, but these errors were encountered: