Advertisement
Guest User

Untitled

a guest
May 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. //uri of asp.net web api
  2. readonly string uri = "http://192.168.1.101//WebApiDemo/api/Values";
  3.  
  4. //This Function call in Android on button click event
  5. public async Task<String> GetCarsAsync()
  6. {
  7. using (HttpClient httpClient = new HttpClient())
  8. {
  9. var response = await httpClient.GetStringAsync(uri);
  10. return JsonConvert.DeserializeObject<String>(response);
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement