Guest User

Untitled

a guest
Nov 28th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. var username = 'x',
  2. password = 'x';
  3.  
  4. var base64 = btoa(username + ":" + password);
  5.  
  6. $.ajax({
  7.  
  8. url: 'x',
  9. type: 'GET',
  10. beforeSend: function(xhr) {
  11.  
  12. xhr.setRequestHeader('Authorization', 'Basic ' + base64);
  13. },
  14.  
  15. data: {}
  16.  
  17.  
  18.  
  19.  
  20. });
Add Comment
Please, Sign In to add comment