Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How use HttpWebResponse and WebResponse in .NET Core?

I'm porting an old C# Shared Lib to a Standard Library. However I'm facing with a lot of System.Net.HttpWebResponse and System.Net.WebResponse references. It used to exist on .Net Framework 4.5 But I'm not able to find similar in .Net standard.

What can I do to be able to use those?

like image 539
Daniel Santos Avatar asked Apr 16 '26 23:04

Daniel Santos


1 Answers

You are actually using System.Net.Requests wich is not available for .NETStandard 1.6 nor for .Net Core.

Try to use the classes in System.Net.Http instead.

Or you can install System.Net.Requests NuGet package through Package Manager Console:

Install-Package System.Net.Requests -Version 4.3.0 

This package contains compatible classes to System.Net.Requests and can be used as replacement of it.

like image 177
S.Dav Avatar answered Apr 18 '26 14:04

S.Dav