Skip to content

Instantly share code, notes, and snippets.

@xsolon
Created July 3, 2020 18:39
Show Gist options
  • Select an option

  • Save xsolon/8fb0a0d6fa7f195e39a0c0ea7848a58c to your computer and use it in GitHub Desktop.

Select an option

Save xsolon/8fb0a0d6fa7f195e39a0c0ea7848a58c to your computer and use it in GitHub Desktop.
restMin.aspx
<!DOCTYPE html>
<%@ Page Language="C#" %>
<html>
<head>
<title>Test - Rest</title>
</head>
<body>
<form>
</form>
<script type="text/javascript">
var request = new XMLHttpRequest();
request.open("POST", '../_api/contextinfo', false);
request.setRequestHeader("accept", "application/json;odata=verbose");
request.send();
var obj = JSON.parse(request.responseText);
var digest = obj.d.GetContextWebInformation.FormDigestValue;
console.log(obj);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment