Inheritance: BaseModel
コード例 #1
0
        public Comment Create(Comment comment)
        {
            var request = new RestRequest("comments.xml", Method.POST) { XmlSerializer = new XmlIgnoreSerializer() };
            request.AddBody(comment);

            var response = _client.Execute<Comment>(request);
            return response.Data;
        }
コード例 #2
0
        public bool Update(Comment comment)
        {
            var request = new RestRequest("comments/{id}.xml", Method.PUT) { XmlSerializer = new XmlIgnoreSerializer() };
            request.AddParameter("id", comment.Id, ParameterType.UrlSegment);
            request.AddBody(comment);

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