示例#1
0
        public async Task <Rootobject> GetMeteorologicalForecast(decimal longitude, decimal latitude)
        {
            string sLongitude = Math.Round(longitude, 3).ToString(new CultureInfo("en"));
            string sLatitude  = Math.Round(latitude, 3).ToString(new CultureInfo("en"));

            string page = $"https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/point/lon/{sLongitude}/lat/{sLatitude}/data.json";

            var smhi = new SmhiService();

            var result = await smhi.Get(page);

            return(JsonConvert.DeserializeObject <Rootobject>(result));
        }
 public void GetForecastAsStringSmhiServiceAsync()
 {
     var    smhi     = new SmhiService();
     string forecast = smhi.Get("https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/point/lon/18.07/lat/59.33/data.json").Result;
 }