Using returned XML from an authorised HTTP request in vb.NET
Posted
by Nathan
on Stack Overflow
See other posts from Stack Overflow
or by Nathan
Published on 2010-05-03T15:43:23Z
Indexed on
2010/05/03
15:48 UTC
Read the original article
Hit count: 656
Hi,
How can I use the returned XML from the reader in a xmltextreader?
' Create the web request
request = DirectCast(WebRequest.Create("https://mobilevikings.com/api/1.0/rest/mobilevikings/sim_balance.xml"), HttpWebRequest)
' Add authentication to request
request.Credentials = New NetworkCredential("username", "password")
' Get response
response = DirectCast(request.GetResponse(), HttpWebResponse)
' Get the response stream into a reader
reader = New StreamReader(response.GetResponseStream())
Thanks in advance,
Nathan.
© Stack Overflow or respective owner