How to use HttpWebResponse and WebResponse in .NET Core?

I am porting the old C # Shared Lib to the standard library. However, I came across a lot of links System.Net.HttpWebResponse

and System.Net.WebResponse

. It used to exist on .Net Framework 4.5 But I couldn't find a similar one in the .Net standard.

What can I do to use them?

+3


source to share


1 answer


You are actually using System.Net.Requests

which is not available for .NETStandard 1.6 or for .Net Core.

Try using classes instead System.Net.Http

.

Or you can install the System.Net.Requests NuGet Package via the Package Manager Console:



Install-Package System.Net.Requests -Version 4.3.0 

      

This package contains compatible classes System.Net.Requests

and can be used as a replacement.

+3


source







All Articles