Add HttpClient to resolve deprecation of WebRequest#26
Open
kiddailey wants to merge 20 commits intoComputerGhost:masterfrom
Open
Add HttpClient to resolve deprecation of WebRequest#26kiddailey wants to merge 20 commits intoComputerGhost:masterfrom
kiddailey wants to merge 20 commits intoComputerGhost:masterfrom
Conversation
Contributor
Author
|
Discovered while testing on Android that I forgot to remove "any" encodings to be accepted in the request headers. Found this when some server response encodings were encoded with Brotli and causing things to fail. Due to NET Framework 2, we can only use Deflate and GZIP, so I limited it to those and removed the weights. Interestingly enough, everything worked fine on iOS and Windows. Only Android was affected. Lots of guesses, but no solid idea why exactly. Weird. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request partially resolves issue #16 and adds support for the use of HttpClient. Please note that this is based on the branch for PR #25 which implements async support, so those changes are included as well.
Given the comment regarding maintaining the shared caching feature, I'm hopeful that this is a good solution as it simply builds upon the existing ISource interface and retains the use of WebRequest by default.
In summary:
Notes:
This obviously means that the caller must specify the source explicitly if they want to use HttpClient. Technically this is better regardless because according to Microsoft, HttpClient should have an extended life and not be constantly disposed. This somewhat encourages the caller to do so. e.g.:
If no source is specified, HttpSource is used, which is the deprecated WebRequest and is the same behavior as exists, e.g.:
I'll add documentation for all this to the readme as well when I can.
NOTE: I have a consolidated branch containing the SVG, Async and HttpClient pull requests into one if preferred. Since each PR is based off of the mainline, it does take a little work to combine them. Let me know