Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var username='email loggin';
- var password='password of pcloud;
- function make_base_auth(user, password) {
- var tok = user + ':' + password;
- var hash = btoa(tok);
- return "Basic " + hash;
- }
- $.ajax
- ({
- type: "GET",
- url: "https://api.pcloud.com/userinfo",
- dataType: 'json',
- async: false,
- data: '{}',
- beforeSend: function (xhr){
- xhr.setRequestHeader('Authorization', make_base_auth(username, password));
- },
- success: function (){
- alert('Working Fine');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement