I want to update a file in SharePoint document library with the following code (in Sharepoint 365). The same as:
http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_FileRequestExampleshttp://msdn.microsoft.com/en-us/library/office/dn292553(v=office.15).aspx#Files
The executeAsync returns success but the file isn't update! Can anybody help!?
var spUrl = appWebUrl + "/_api/SP.AppContextSite(@target)/web/GetFileByServerRelativeUrl('" + itemUrl + "')/$value?@target='" + hostWebUrl + "'"; var executor = new SP.RequestExecutor(appWebUrl); executor.executeAsync( { url: spUrl, type: "POST", body: "Here is the new Body", headers: {"X-HTTP-Method": "PUT","X-RequestDigest": $("#__REQUESTDIGEST").val() }, success: readContents, error: errorHandler, state: "Update" });