David Bonnici
David Bonnici

Reputation: 6747

Using HTTPWebRequest in ASP.NET VB

I don't have any idea how to use this class in .net. Anyone wants to share his knowledge how to implement and use this class?

Have you got any simple procedure that calls a page and process it?

Upvotes: 0

Views: 5518

Answers (2)

Guffa
Guffa

Reputation: 700152

The easiest way is to use the WebClient class that simplifies most common uses of HttpWebRequest.

Example in C#:

string page;
using (WebClient client = new WebClient()) {
   page = client.DownloadString("http://www.guffa.com");
}

Upvotes: 4

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

Dim request = HttpWebRequest.Create("http://www.google.com")
Dim response = request.GetResponse()
Using reader = New StreamReader(response.GetResponseStream())
    Console.WriteLine(reader.ReadToEnd())
End Using

Upvotes: 4

Related Questions