Пример #1
0
        public HttpResponseMessage Get(string adminServiceGetAll)
        {
            _adminServiceRequest         = new AdminServiceHttpRequest(User, Request.GetQueryNameValuePairs());
            _adminServiceRequest.UrlPath = adminServiceGetAll;
            var json     = _adminServiceRequest.InvokeWebRequest();
            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent(json, Encoding.UTF8, "application/json");
            return(response);
        }
Пример #2
0
        public async System.Threading.Tasks.Task <HttpResponseMessage> PutAsync(string adminServiceGetAll)
        {
            string strBody = "";

            strBody = await Request.Content.ReadAsStringAsync();

            var ct = Request.Content.Headers.ContentType;

            _adminServiceRequest         = new AdminServiceHttpRequest(User, Request.GetQueryNameValuePairs());
            _adminServiceRequest.UrlPath = adminServiceGetAll;
            _adminServiceRequest.Body    = strBody;
            if (ct != null)
            {
                _adminServiceRequest.ContentType = ct.ToString();
            }
            _adminServiceRequest.Method = "PUT";
            var json     = _adminServiceRequest.InvokeWebRequest();
            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent(json, Encoding.UTF8, "application/json");
            return(response);
        }