I am currently using the following code to create a web request:
Dim myRequest As WebRequest = WebRequest.Create("http://foo.com/bar")
Dim myResponse As WebResponse = myRequest.GetResponse()
The problem is that it “blocks” the program until the request completes (and the program freezes if the request never completes). How do I change something like this to execute asynchronously so that other tasks can be completed during the completion of the web request?
source
share