Is there a built-in .NET class that can replace or work like WinHttp.WinHttpRequest?
Thanks!
Is there a built-in .NET class that can replace or work like WinHttp.WinHttpRequest?
Thanks!
There is the System.Net.HttpRequest class:
Provides an HTTP-specific implementation of the WebRequest class.
You can alternatively use the System.Net.WebClient class:
Provides common methods for sending data to and receiving data from a resource identified by a URI.
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.
You might find this question interesting (includes code) - Downloading a URL with timeout