Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub test()
- Dim HttpClient2 As HttpClient = New HttpClient()
- Dim request = New HttpRequestMessage(HttpMethod.[Post], "http://www.google.com/")
- Dim response = Await HttpClient.SendAsync(request) '!!!!Error on Await!!!!
- Dim result = response.Content.ReadAsStringAsync().Result
- End Sub
- Async Function AccessTheWebAsync() As Task(Of Integer)
- Dim client As HttpClient = New HttpClient()
- Dim getStringTask As Task(Of String) = client.GetStringAsync("http://google.com")
- Dim urlContents As String = Await getStringTask
- Return urlContents.Length
- End Function
Advertisement
Add Comment
Please, Sign In to add comment