Bestbuy Remix API (Using ASP.NET)

Easily Read Bestbuy Remix API data using ASP.NET

 

Imports System.Data
Imports System.Xml
Imports System.Net
Imports System.IO

Partial Class BestBuy_Default
    Inherits System.Web.UI.Page

 


    Private Sub ReadXml()

        Dim iRequest As HttpWebRequest = HttpWebRequest.Create(http://api.remix.bestbuy.com/v1/products(manufacturer='canon')?&apiKey=xxxx)


        Dim iResponse As HttpWebResponse = iRequest.GetResponse

        Dim reader As New StreamReader(iResponse.GetResponseStream)


        Dim iDoc As New XmlDocument
        iDoc.LoadXml(reader.ReadToEnd)

        Dim ProductNode As XmlNodeList
        ProductNode = iDoc.GetElementsByTagName("product")

        For Each Item As XmlNode In ProductNode

            Dim ChildNodes As XmlNodeList = Item.ChildNodes

            For Each Item2 As XmlNode In ChildNodes

                xxx.Text += "" & Item2.Name & " : " & Item2.InnerText & "
"

                If Item2.Name = "image" Then
                    xxx.Text += ""
                End If


            Next
            xxx.Text += "


"
        Next

 

 


    End Sub

 


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Call Me.ReadXml()

    End Sub

End Class
 

Posted by:

No comments posted.

Name :  

Email :  

Comment Below