Пример #1
0
        public Case Create(Case kase)
        {
            var request = new RestRequest("kases.xml", Method.POST) { XmlSerializer = new XmlIgnoreSerializer() };
            request.AddBody(kase);

            var response = _client.Execute<Case>(request);
            return response.Data;
        }
Пример #2
0
        public bool Update(Case kase)
        {
            var request = new RestRequest("kases/{id}.xml", Method.PUT) { XmlSerializer = new XmlIgnoreSerializer() };
            request.AddParameter("id", kase.Id, ParameterType.UrlSegment);
            request.AddBody(kase);

            var response = _client.Execute<Case>(request);
            return response.StatusCode == HttpStatusCode.OK;
        }