Exemple #1
0
        public async Task <Clima> ObtenerClima()
        {
            try
            {
                ZipHttpClient client = new ZipHttpClient(UrlBase);

                var response = await client.HttpRequest(RequestString);

                if (!response.IsSuccessStatusCode)
                {
                    throw new Exception(response.ReasonPhrase);
                }

                var responseContent = await response.Content.ReadAsStringAsync();

                return(MapStringToClima(responseContent));
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemple #2
0
 public void DisposeTest()
 {
     using var service = new ZipHttpClient();
     service.Dispose();
 }