仅返回一个嵌套的Web API值

时间:2018-11-26 22:48:26

标签: vb.net

我只需要返回一个嵌套的api值,这是我的代码

Private Sub BunifuFlatButton2_Click(sender As Object, e As EventArgs) Handles BunifuFlatButton2.Click


    Dim sUrl As String = "https://api.csgofloat.com/?url=" + TextBox1.Text
    Dim uri As New Uri(sUrl)


    'request
    Dim wRequest As HttpWebRequest = HttpWebRequest.Create(uri)
    wRequest.Method = "GET"


    'response
    Dim wResponse As HttpWebResponse = wRequest.GetResponse()
    'Dim sResponse As String = ""


    'read response
    Dim read = New StreamReader(wResponse.GetResponseStream())
    Dim raw As String = read.ReadToEnd()



    Dim dict As Object = New JavaScriptSerializer().Deserialize(Of List(Of Object))((raw))

    For Each item As Object In dict
        TextBox2.Text = TextBox2.Text + item("floatvalue").ToString
    Next

End Sub

和api链接API CSGOFLOAT

我只想返回api json的float值

0 个答案:

没有答案