Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinHttp.WinHttpRequest in .NET

Is there a built-in .NET class that can replace or work like WinHttp.WinHttpRequest?

Thanks!

like image 881
Leon Tayson Avatar asked Sep 12 '26 11:09

Leon Tayson


1 Answers

There is the System.Net.HttpRequest class:

HttpWebRequest Class

Provides an HTTP-specific implementation of the WebRequest class.

  • Namespace: System.Net
  • Assembly: System (in System.dll)

You can alternatively use the System.Net.WebClient class:

WebClient Class

Provides common methods for sending data to and receiving data from a resource identified by a URI.

  • Namespace: System.Net
  • Assembly: System (in System.dll)

This class simplifies some common tasks, like downloading a file (method DownloadFile)

The WebClient class provides common methods for sending data to or receiving data from any local, intranet, or Internet resource identified by a URI.

The WebClient class uses the WebRequest class to provide access to resources. WebClient instances can access data with any WebRequest descendant registered with the WebRequest.RegisterPrefix method.

like image 111
splattne Avatar answered Sep 15 '26 08:09

splattne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!