Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ajax authorization header token

$.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 () { },
});
Comment

ajax authorization header token

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);
Comment

PREVIOUS NEXT
Code Example
Javascript :: python object to json 
Javascript :: create a category discord.js 
Javascript :: angular 8 to 9 
Javascript :: how to register key presses in p5.js 
Javascript :: javascript open new window 
Javascript :: how to print an array in javascript 
Javascript :: postman test save token 
Javascript :: asp.net core 3.1 convert system.collections.generic.list`1[system.string] to javascript 
Javascript :: js get date from datetime 
Javascript :: remove first char javascript 
Javascript :: javascript for loop starting from end 
Javascript :: samesite cookie nodejs 
Javascript :: remove time from date javascript 
Javascript :: is javascript variable also an object 
Javascript :: vue data 
Javascript :: eslint allow console 
Javascript :: string contains in javascript 
Javascript :: vue watch immediate 
Javascript :: how select just before element in jquery 
Javascript :: how to display items quantity into select input field 
Javascript :: how to make slide js in owl carousel auto 
Javascript :: remove trailing slash javascript 
Javascript :: style react background 
Javascript :: get the value of a checkbox jquery 
Javascript :: vite install in vue 
Javascript :: react open url with button 
Javascript :: js domtokenlist to array 
Javascript :: javascript multiline string 
Javascript :: jquery key enter events 
Javascript :: typescript css variables 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =