Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

need to convert the following into restsharp code!

$
0
0

Trying to figure out restsharp but unable to do in Restsharp. any help?

public async Task<Earthquake[]> GetEarthquakesAsync () {

            var client = new System.Net.Http.HttpClient ();

            client.BaseAddress = new Uri("http://api.geonames.org/");

            var response = await client.GetAsync("earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=bertt");

            var earthquakesJson = response.Content.ReadAsStringAsync().Result;

            var rootobject = JsonConvert.DeserializeObject<Rootobject>(earthquakesJson);

            return rootobject.earthquakes;

        }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>