1
I want to access the URL ("https://economia.awesomeapi.com.br/usd-brl") to fetch the json Ask field.
How do I request the URL and get the desired value in a variable?
I tried something like:
Dim json As String = GetWebPageText("https://economia.awesomeapi.com.br/usd-brl")
Private Function GetWebPageText(ByVal url As String) As String
Try
Dim Request As WebRequest = WebRequest.Create(url)
Request.Credentials = CredentialCache.DefaultCredentials
Return New StreamReader(Request.GetResponse().GetResponseStream()).ReadToEnd()
Catch ex As Exception
Return ""
End Try
End Function
Worked ... ???
– novic
Excellent! Thanks @Virgilionovic for the clarity in the example and the layout!
– Developer1903