Skip to content
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

Add Separate Response Hooks #3762

Merged
merged 15 commits into from
Aug 31, 2023
Merged

Add Separate Response Hooks #3762

merged 15 commits into from
Aug 31, 2023

Conversation

jshier
Copy link
Contributor

@jshier jshier commented Aug 18, 2023

Issue Link πŸ”—

#3401

Goals ⚽

This PR adds onHTTPResponse closure hooks to DataRequest / UploadRequest and DataStreamRequest to enable the cancellation of requests before data is transferred, requests that need to check response info for later parsing, or peculiar requests that may trigger multiple response callbacks, like MJPEG streams.

Implementation Details 🚧

Like the other value hooks, this API accepts a single closure. The only unique bit here is that there's second, disfavored, version of the API that allows the user to return ResponseDisposition value to cancel or end the request without the body.

Testing Details πŸ”

Streaming tests are being updated to check these events always fire before the other events. More tests are needed around cancellation or ending behavior to ensure that's really possible.

@jshier jshier merged commit 1da2d91 into master Aug 31, 2023
43 checks passed
@jshier jshier deleted the feature/initial-response branch August 31, 2023 21:29
@jshier jshier added this to the 5.8.0 milestone Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant