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

feat: remove System.Net.Http #221

Merged

Conversation

NickDarvey
Copy link
Contributor

@NickDarvey NickDarvey commented Apr 13, 2023

It seems HttpClient is available if you're targeting netstandard2.01 and doesn't need to be included as a NuGet package2. This PR removes the System.Net.Http dependency (which has a lot of dependencies itself). The tests still pass.

Footnotes

  1. HttpClient Class (System.Net.Http) | Microsoft Learn

  2. The State of HttpClient and .NET Multi-Targeting | leastprivilege.com

    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.

…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.
@sergey-tihon sergey-tihon merged commit 29bd9e2 into fsprojects:master Apr 14, 2023
@sergey-tihon
Copy link
Member

Good catch, thank you!

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.

2 participants