Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use the System.Net.Http Nuget Package?

.NET Framework 4.6.2 seems to have the System.Net.Http assembly/namespace built in. There is also a Nuget package of the same name that I can install.

As a general principal, can a Nuget package replace (e.g. update) an assembly that is included in the installed framework?

And specifically, should I use the Nuget version or the framework version of System.Net.Http?

like image 839
MetaMapper Avatar asked Jul 05 '18 14:07

MetaMapper


People also ask

What is the use of System NET HTTP?

The System. Net. Http namespace is designed to provide the following: HTTP client components that allow users to consume modern web services over HTTP.

Is System NET HTTP deprecated?

The old System. Net. Http packages (the 2.0 ones) are legacy packages which are deprecated in favor of Microsoft.Http.Net according to the description: Legacy package, System.

Is it safe to use NuGet package?

NuGet doesn't manage trust. Even if it did, you would still have to be concerned about trusting what NuGet trusts. You should absolutely be concerned about the safety of the code in a NuGet package. You should be concerned about the safety of any code you are not familiar with.

What is the latest version of System NET HTTP?

The latest version of System. Net. Http on nuget is 4.3.

What is System NET HTTP DLL?

Definition. Namespace: System.Net.Http Assembly: System.Net.Http.dll. Provides a class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.


1 Answers

In general, you can replace the framework library with one from NuGet. I would recommend to do it if you have a specific reason to do it. For example, if you need a bug fix, a new API or leverage performance improvements.

Specifically, with System.Net.Http it depends on your scenario. If you are making 1000 http calls a minute, use the newest from the NuGet. If you are making 2 calls an hour and you are not facing any issue, stick with the framework version. Between these two numbers, it depends.

like image 125
Jakub Šturc Avatar answered Nov 03 '22 23:11

Jakub Šturc