Search code examples
c#webrequest

Does WebRequest.Create method actually calls a url?


One of my colleague suggested me WebRequest.Create actually sends a web request to the specified url and I don't have to use asynchronous web request in order to avoid waiting.

Is this true?

How ever I don't agree with him and when I showed him the documentation but he said that he has been calling WebRequest.Create to send requests.

I'm not sure if this is true as i don't have deep knowledge of .net


Solution

  • No, calls to GetResponse() on the created WebRequest is what actually issues the request.

    From the docs:

    The GetResponse method sends a request to an Internet resource and returns a WebResponse instance.