示例#1
0
        public int CreateEntry(Entry entry)
        {
            var request = new ZenRestRequest
            {
                Method = Method.POST,
                Resource = Entries + ".xml"
            };

            request.AddBody(entry);

            var res = Execute(request);

            return GetIdFromLocationHeader(res);
        }
示例#2
0
        public bool UpdateEntry(Entry entry)
        {
            var request = new ZenRestRequest
            {
                Method = Method.PUT,
                Resource = string.Format("{0}/{1}.xml", Entries, entry.Id)
            };

            request.AddBody(entry);

            var res = Execute(request);

            return res.StatusCode == System.Net.HttpStatusCode.OK;
        }