-
Notifications
You must be signed in to change notification settings - Fork 269
Adding new helper functions to internal.HTTPClient API #269
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
341870b
Adding experimental OP client
hiranya911 74a82ed
Added unit tests
hiranya911 fee5f49
Made the client more generic
hiranya911 bd0a5d0
Cleaned up some error checks
hiranya911 d8bc823
Merged JSONHTTPClient into HTTPClient
hiranya911 24cdcf8
Moved test case
hiranya911 e9e356a
Further simplified the helper functions
hiranya911 19f605a
Added CreateErrFn and SuccessFn types
hiranya911 886533c
Support for retrying on read errors
hiranya911 954703e
Reverted the changes made to auth/ files
hiranya911 450a306
Updated documentation
hiranya911 9b1b952
Using CreateErrFn type in Request
hiranya911 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kinda weird for both
HTTPClient
andRequest
to have so many fields in common. Would it make sense to package them into a separate struct that they each get a pointer to?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with that is, callers have to use another level of nesting to specify common properties:
I'd prefer following over that:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair.
I do feel like these http methods have probably gotten more complicated than they need to be, and maybe we got some abstraction wrong that's making thing needlessly difficult. But I don't have any specific objections to this change. Certainly nothing worth holding this PR up any longer.
But I think we should brainstorm how to clean this up at some point.