$.ajax({
url: 'https://api.sandbox.slcedu.org/api/rest/v1/students/test1',
type: 'GET',
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', 'Bearer t-7614f875-8423-4f20-a674-d7cf3096290e');
},
data: {},
success: function () { },
error: function () { },
});
headerParams = {'Authorization':'bearer t-7614f875-8423-4f20-a674-d7cf3096290e'};
obj = {
type: 'get',
url: 'https://api.sandbox.slcedu.org/api/rest/v1/students/test1',
headers: headerParams,
data: [],
dataType: 'json',
processData: false,
success: function(data) {
console.log('success');
console.log(data);
}
};
jQuery.ajax(obj);