Пример #1
0
        public async Task <TReturn> HttpGet <TReturn>(string route, string queryString = "") where TReturn : new()
        {
            string fullUrl = route +
                             (string.IsNullOrWhiteSpace(queryString)?"":
                              ("?" + queryString));
            var apiResult = await _connector.GetAsync <TReturn>(fullUrl);

            if (apiResult.IsSuccess)
            {
                return(apiResult.GetData());
            }
            else
            {
                throw new Exception(apiResult.Message);
            }
        }