Example #1
0
 public async Task <ForecastResponseClient> GetWeatherByLocationAsync(string lon, string lat)
 {
     try
     {
         ForecastResponseClient response = new ForecastResponseClient();
         string parameters = "forecast?lat=" + lat + "&lon=" + lon + "&units=" + _units + "&APPID=";
         ForecastResponseApi forecastResponseApi = ApiRequester.OpenWeatherApiCall(_baseUrl, parameters, _apikey, "GET");
         return(LoadWeatherCol(response, forecastResponseApi));
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Example #2
0
 public async Task <ForecastResponseClient> GetWeatherByZipCodeAsync(string zipCode)
 {
     try
     {
         ForecastResponseClient response = new ForecastResponseClient();
         string parameters = "forecast?zip=" + zipCode + ",es" + "&units=" + _units + "&APPID=";
         ForecastResponseApi forecastResponseApi = ApiRequester.OpenWeatherApiCall(_baseUrl, parameters, _apikey, "GET");
         return(LoadWeatherCol(response, forecastResponseApi));
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }