feat: remove System.Net.Http#221
Merged
sergey-tihon merged 1 commit intofsprojects:masterfrom Apr 14, 2023
Merged
Conversation
…need to be included as a NuGet package[^2]. This PR removes the `System.Net.Http` dependency (which has a lot of dependencies itself). The tests still pass. [^1]: [HttpClient Class (System.Net.Http) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=netstandard-2.0) [^2]: [The State of HttpClient and .NET Multi-Targeting | leastprivilege.com](https://leastprivilege.com/2018/05/21/the-state-of-httpclient-and-net-multi-targeting/) > With .NET Core 2.0 and .NET Standard 2.0 you shouldn’t need to reference the SystemNetHttpClient NuGet package at all. [...] Same goes for .NET Framework: if you target 4.5 and up, you should generally use the in-box version instead of the NuGet package.
Member
|
Good catch, thank you! |
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.
It seems
HttpClientis available if you're targeting netstandard2.01 and doesn't need to be included as a NuGet package2. This PR removes theSystem.Net.Httpdependency (which has a lot of dependencies itself). The tests still pass.Footnotes
HttpClient Class (System.Net.Http) | Microsoft Learn ↩
The State of HttpClient and .NET Multi-Targeting | leastprivilege.com
↩