Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: 'GET',
- url: 'http://localhost/owncloud/index.php/apps/news/api/2.0/version',
- contentType: 'application/json',
- success: function (response) {
- // handle success
- },
- error: function () {
- // handle errors
- },
- beforeSend: function (xhr) {
- var username = 'admin';
- var password = 'admin';
- var auth = btoa(username + ':' + password);
- xhr.setRequestHeader('Authorization', 'Basic ' + auth);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement