[Solved] Finding location using google API in mvc 5


I have worked with freegeoip and to get the geo location from this is as below.

URL:- http://freegeoip.net/xml/{ip}

In this you can provide your IP and can see result in browser.

Implementation in code.

string apiUrl = http://freegeoip.net/xml/{ip}

HttpClient HttpClient = new HttpClient();

var response = HttpClient.GetAsync(apiUrl).Result;

if (response != null && response.ReasonPhrase != "Unauthorized")
 {
   var myobject = response.Content.ReadAsStringAsync();

 }

0

solved Finding location using google API in mvc 5