I am having trouble updating content via the REST API. The end goal is to update the tags on a variety of content (wikis, blogs, files, etc). I was unable to get that to work, so I've been just trying to update the body of a blog post and that isn't working either. My first attempt followed the Update Blog Post REST Endpoint API documentation:
var response = host.PutToDynamicAsync(2, "blogs/{blogid}/posts/{id}.json", false, new RestPutOptions { AdditionalHeaders = headers, PathParameters = new System.Collections.Specialized.NameValueCollection { {"blogid", dataRow("SectionId")}, {"id", dataRow("ContentId")}, {"body", "body updated"} } });
I then saw another question here that said you need to use a post with a rest-method header of put, so I tried the below code:
headers.Add("Rest-Method", "PUT"); var response = host.PostToDynamicAsync(2, "blogs/{blogid}/posts/{id}.json", false, new RestPostOptions { AdditionalHeaders = headers, PathParameters = new System.Collections.Specialized.NameValueCollection { {"blogid", dataRow("SectionId")}, {"id", dataRow("ContentId")}, {"body", "body updated"} } });
Both sets of code do not result in any errors from the response, however they also don't successfully update the body of the blog. Any ideas what I'm doing wrong?