SpRestLib icon indicating copy to clipboard operation
SpRestLib copied to clipboard

sprLib.folder().add() requires requestDigest / security token

Open joske500 opened this issue 6 years ago • 1 comments
trafficstars

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.

joske500 avatar Jun 17 '19 07:06 joske500

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?

dennythecoder avatar Jul 29 '19 19:07 dennythecoder