What is the request digest value?
Loading
What is the request digest value?
Request digest is a client side “token” to validate posts back to SharePoint to prevent attacks where the user might be tricked into posting data back to the server. The token is unique to a user and a site and is only valid for a (configurable) limited time.
You can get the request digest value as below:
$.ajax({
url: _spPageContextInfo.siteAbsoluteUrl + “/_api/web/,,,”,
method: “POST”,
headers: {
“Accept”: “application/json; odata=verbose”,
“X-RequestDigest”: $(‘#__REQUESTDIGEST’).val()
},
success: function (data) {},
error: function (data, errorCode, errorMessage) {}
});