Advertisement
Shell_Casing

vanilla

Dec 7th, 2018
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let token = {
  2.     "access_token":"eyJhbGciOiJSUzI1NiJ9.eyJqdGIsImhpc3Rvcmlhbl9z87rks8V38Q"
  3. };
  4.  
  5.  
  6. const checkAPI = document.querySelector('#checkAPI');
  7. checkAPI.addEventListener('click', checkHistorianAPI);
  8.  
  9. let url = `http://10.1.1.31:80/historian-rest-api/v1/tags?nameMask=*&maxNumber=100`;
  10.  
  11. async function checkHistorianAPI() {
  12.     let response = await fetch(url, {
  13.         method: 'get',
  14.         headers: {
  15.             "Authorization": `Bearer ${token.access_token}`,
  16.             'mode': 'cors'
  17.         }});
  18.     console.log(response);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement