예제 #1
0
        /// <summary>
        /// Makes GET request to the specified URL and converts response to the specified type.
        /// </summary>
        /// <typeparam name="T">Type of the desired response.</typeparam>
        /// <param name="url"></param>
        /// <returns>Specified type. Will return an empty object on failure.</returns>
        public EasyHttpResponse <T> Get <T>(string url)
        {
            var result   = Get(url);
            var response = new EasyHttpResponse <T>(result);

            return(response);
        }
예제 #2
0
        /// <summary>
        /// Makes GET request to the specified URL and converts response to the specified type.
        /// </summary>
        /// <typeparam name="T">Type of the desired response.</typeparam>
        /// <param name="url"></param>
        /// <returns>Specified type. Will return an empty object on failure.</returns>
        public async Task <EasyHttpResponse <T> > GetAsync <T>(string url)
        {
            var result = await GetAsync(url);

            var response = new EasyHttpResponse <T>(result);

            return(response);
        }