Advertisement
Guest User

Untitled

a guest
Mar 8th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var user='email loggin';
  2. var password='password of pcloud';
  3.  
  4. function make_base_auth(user, password) {
  5. var tok = user + ':' + password;
  6. var hash = btoa(tok);
  7. return "Basic " + hash;
  8. }
  9.  
  10. $.ajax
  11. ({
  12. type: "GET",
  13. url: "https://api.pcloud.com/userinfo",
  14. dataType: 'json',
  15. async: false,
  16. data: '{}',
  17. beforeSend: function (xhr){
  18. xhr.setRequestHeader('Authorization', make_base_auth(username, password));
  19. },
  20. success: function (){
  21. alert('Working Fine');
  22. }
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement