Post to web page (quickie)

  • Thread starter Thread starter Chris, Master of All Things Insignificant
  • Start date Start date
C

Chris, Master of All Things Insignificant

I have a web page that just returns an XML stream back. I don't have any
control over that site so a web service is not possible. What classes will
I use to do the post and get the response back? I just need a push in the
right direction. If I must use HTTPWebRequest, do I need to do it async?

Thanks Guys & Gals

Chris
 
Finally solved the problem
' Address of URL

Dim URL As String = http://SomeURL

Try

' Get HTML data

Dim client As System.Net.WebClient = New System.Net.WebClient

Dim Data As System.io.Stream = client.OpenRead(URL)

Dim reader As System.io.StreamReader = New System.io.StreamReader(Data)

Dim str As String = ""

str = reader.ReadLine()

Do While (Not str Is Nothing)

Console.WriteLine(str)

str = reader.ReadLine()

Loop

Data.Close()

Catch exp As System.net.WebException

MessageBox.Show(exp.Message, "Exception")

End Try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top