This repository has been archived by the owner on May 5, 2023. It is now read-only.
In case of inputStream, invoke callback on response event #320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A suggested improvement for the fix in #251. In the case of an inputStream, invoke callback on the 'response' event instead of waiting for the entire response to arrive. In this case, the callback will contain the response but not the responseBody. This should be ok, however, since the body is being sent to the stream. Also, there was already an 'if' statement in the callback to skip assigning the body when an inputStream existed (I assume this 'if' statement is no longer necessary so I removed it).
The existing fix for #251 helps, but does not solve the entire problem for me. However since #251 added 'request', it made it easier to act on the arrival of the response prior to the arrival of the entire body.
Thanks!