Tuesday, May 12, 2020

What is the use of _REQUESTDIGEST in Rest API call?

What is the use of _REQUESTDIGEST in Rest API call?

Ans:- In Rest API call you must add a valid request digest to your request in case of POST, MERGE, DELETE. This digest proves validity of your request to SharePoint. Because this token is valid by only for a limited period of time of by default 30 minutes, you have to ensure that the token you have is valid before adding it to your request or the request fails.

In classic pages, SharePoint includes a request digest token on the page in a hidden field named _REQUESTDIGEST.  

If the user has the page open for a longer period of time, the request digest on the page expires and the request fails with a 403 FORBIDDEN result.

No comments:

Post a Comment