I try to call data JSON from URL, and the source need authentication bearer I create in codeigniter framework this is my reference link
and here is my code,
$.ajax({
url: "url",
method: "GET",
headers: {
'Token': Bearer +'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWF0IjoxNTgwMTg1MjA0LCJleHAiOjE1ODAxODg4MDR9.dG13Tv62YHgdH9SD1HKPCc_JSAVgqrJb70UlR-bqy4E'
},
contentType: 'application/json',
success: function(data) {
},
error: function (data, status, xhr) {
console.log(status);
console.log(xhr);
}
});
any help would be appreciated.