Пример #1
0
        public T SendGet <T>(string url, Parameters parameter)
        {
            var uri = new Uri(HttpClientUtils.MountUrl(UrlBase, url, parameter));

            var t = Task.Run(() => GetURI(uri));

            t.Wait();

            return(HttpClientUtils.Deserialize <T>(t.Result));
        }
Пример #2
0
        public T SendPut <T, U>(string url, Parameters parameter, U content)
        {
            var uri  = new Uri(HttpClientUtils.MountUrl(UrlBase, url, parameter));
            var json = HttpClientUtils.Serialize <U>(content);

            var t = Task.Run(() => PutURI(uri, HttpClientUtils.CreateHttpContent(json)));

            t.Wait();

            return(HttpClientUtils.Deserialize <T>(t.Result));
        }