SpRestLib
SpRestLib copied to clipboard
sprLib.folder().add() requires requestDigest / security token
Hi,
I'm using the SpRestLib in Node and was unable to make sprLib.folder().add() work, I always got the error message "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.".
When I do the call manually via
sprLib.rest({ type: "POST", url: vURL, requestDigest: token, metadata: false })
It does work, it seems that SharePoint expects the requestDigest for folder add operations as well.
It appears that the request digest is not sent on the method at https://github.com/gitbrent/SpRestLib/blob/master/dist/sprestlib.js#L782. I'd be willing to do a PR for this issue. @gitbrent, is the repo being developed in the /dist folder?