Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <script type="text/javascript">
  2. var MyJSONText = '{"client_id":"<<MY_CLIENT_ID>>","client_secret":"<<MY_CLIENT_SECRET>>","grant_type":"client_credentials","expiration":"1440","f":"json"}';
  3. var MyJSON = JSON.parse(MyJSONText);
  4. xhr = new XMLHttpRequest();
  5. xhr.open("POST", "https://www.arcgis.com/sharing/rest/oauth2/token/");
  6. xhr.send(MyJSON);
  7. xhr.onreadystatechange = function ()
  8. {
  9. if (xhr.readyState == 4 && xhr.status == 200)
  10. {
  11. alert(xhr.responseText);
  12. }
  13. }
  14.  
  15. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement