コード例 #1
0
        public async Task <Trivial> getTrivial()
        {
            Trivial trivial;

            httpClient = new MiHttpClient();
            Uri myUri = new Uri(uriTivial);

            try
            {
                String respuesta = await httpClient.miHttpClient.GetStringAsync(myUri);

                httpClient.miHttpClient.Dispose();
                trivial = JsonConvert.DeserializeObject <Trivial>(respuesta);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(trivial);
        }
コード例 #2
0
        public async Task <int> getVersiontrivial()
        {
            Trivial trivial;
            int     version = 0;

            httpClient = new MiHttpClient();
            Uri myUri = new Uri(uriTrivialVersion);

            try
            {
                String respuesta = await httpClient.miHttpClient.GetStringAsync(myUri);

                httpClient.miHttpClient.Dispose();
                trivial = JsonConvert.DeserializeObject <Trivial>(respuesta);
                version = int.Parse(trivial.Version);
            }
            catch (Exception ex)
            {
                throw ex;
            }


            return(version);
        }