I m trying to invoke a URL in C#, I am just interested in invoking, and dont care about response. When i have the following, does it mean that I m invoking the URL?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
You can use this:
string address = "http://www.yoursite.com/page.aspx";
using (WebClient client = new WebClient())
{
client.DownloadString(address);
}
You need to actually perform the request:
var request = (HttpWebRequest)WebRequest.Create(url);
request.GetResponse();
The call to GetResponse makes the outbound call to the server. You can discard the response if you don't care about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With