Advertisement
CryptoJones

ConsumeAnApi

Nov 24th, 2017
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.59 KB | None | 0 0
  1.             Dim client As HttpClient = New HttpClient()
  2.             client.BaseAddress = new Uri("https://api.cheapweather.com/")
  3.             client.DefaultRequestHeaders.Accept.Clear()
  4.             client.DefaultRequestHeaders.Add("token", accessToken)
  5.             client.DefaultRequestHeaders.Accept.Add(New MediaTypeWithQualityHeaderValue("application/json"))
  6.             Dim response As HttpResponseMessage = client.GetAsync("v1/zip/" + ZipOption.Text).Result
  7.             If response.IsSuccessStatusCode Then
  8.                 Dim data = response.Content.ReadAsStringAsync().Result
  9.             End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement