Invoking a URL - c#

后端 未结 5 2067
渐次进展
渐次进展 2021-01-11 21:27

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?

5条回答
  •  梦毁少年i
    2021-01-11 21:48

    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.

提交回复
热议问题