Beispiel #1
0
        public TResult Delete <TResult>()
        {
            var client = new HttpClientUtility(new Uri(_url));
            var result = client.DeleteAsync <TResult>(
                _url,
                MediaTypeEnum.Json,
                GetHeaderRequestInfo());

            return(result);
        }
Beispiel #2
0
        public T Post <T>(dynamic obj)
        {
            var client = new HttpClientUtility(new Uri(_url));
            var result = client.PostAsync <T, object>(
                _url,
                MediaTypeEnum.Json,
                obj,
                GetHeaderRequestInfo());

            return(result);
        }
Beispiel #3
0
        public T Get <T>(dynamic obj)
        {
            var fullPath = _url;

            if (obj != null)
            {
                var param = ToData(ToNameValueCollection(obj));
                fullPath += "?" + param;
            }
            var client = new HttpClientUtility(new Uri(fullPath));
            var result = client.GetAsync <T>(
                fullPath,
                MediaTypeEnum.Json,
                GetHeaderRequestInfo());

            return(result);
        }