Last active
July 3, 2020 18:08
-
-
Save xsolon/fff9376c10ba12e821beeb4e3d759681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<%@ Page Language="C#" %> | |
<html> | |
<head> | |
<title>Rest 2</title> | |
</head> | |
<body> | |
<form> | |
<input type="hidden" id="__REQUESTDIGEST" name="__REQUESTDIGEST"> | |
</form> | |
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$.ajax({ | |
url: '../_api/contextinfo', | |
type:'POST', | |
headers: { | |
"accept": "application/json;odata=verbose", | |
"content-type": "application/json;odata=verbose", | |
}, | |
success:function(data){ | |
$('__REQUESTDIGEST').val(data.d.GetContextWebInformation.FormDigestValue); | |
console.log(data.d.GetContextWebInformation); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment