Advertisement
Guest User

Untitled

a guest
Nov 29th, 2017
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.65 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <title>Женя лох!!1</title>
  5.   <meta charset="utf-8">
  6. </head>
  7.  
  8. <body>
  9.  
  10.   <script>
  11.  
  12.     var req = new XMLHttpRequest();
  13.     var url = "http://localhost:8080/oauth/token?grant_type=password&username=IIvanov@gmail.com&password=password";
  14.    
  15.     req.open('POST', url, true);
  16.     req.setRequestHeader('Authorization', 'Basic Y2xpZW50OnNlY3JldA==');
  17.     req.send();
  18.    
  19.     req.addEventListener('load', function() {
  20.       document.write(this.responseText);
  21.     });
  22.    
  23.     req.addEventListener('error', function() {
  24.       console.log(this.responseText);
  25.     });
  26.    
  27.   </script>
  28.  
  29. </body>
  30.  
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement