Skip to content

feat: remove System.Net.Http#221

Merged
sergey-tihon merged 1 commit intofsprojects:masterfrom
NickDarvey:feat/remove-system-net-http
Apr 14, 2023
Merged

feat: remove System.Net.Http#221
sergey-tihon merged 1 commit intofsprojects:masterfrom
NickDarvey:feat/remove-system-net-http

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