// Set header for every ajax request
$.ajaxSetup( {beforeSend: function(jqXHR) {
jqXHR.setRequestHeader( "Authorization", "__API__" );
} } );
$.ajax({
url: "__LINK__",
type: "GET",
dataType: "json",
success: function (json) {
console.log(json);
}
});
pst = __DATA__;
// Set header for every ajax request
$.ajaxSetup( {beforeSend: function(jqXHR) {
jqXHR.setRequestHeader( "Authorization", "__API__" );
} } );
$.ajax({
url: "__LINK__",
type: "POST",
data: JSON.stringify(pst),
dataType: "json",
success: function (json) {
console.log(json);
}
});
pst = __DATA__;
// Set header for every ajax request
$.ajaxSetup( {beforeSend: function(jqXHR) {
jqXHR.setRequestHeader( "Authorization", "__API__" );
} } );
$.ajax({
url: "__LINK__",
type: "POST",
data: pst,
cache: false,
contentType: false,
processData: false,
success: function (json) {
console.log(json);
}
});
pst = __DATA__;
// Set header for every ajax request
$.ajaxSetup( {beforeSend: function(jqXHR) {
jqXHR.setRequestHeader( "Authorization", "__API__" );
} } );
$.ajax({
url: "__LINK__",
type: "PUT",
data: JSON.stringify(pst),
dataType: "json",
success: function (json) {
console.log(json);
}
});
// Set header for every ajax request
$.ajaxSetup( {beforeSend: function(jqXHR) {
jqXHR.setRequestHeader( "Authorization", "__API__" );
} } );
$.ajax({
url: "__LINK__",
type: "DELETE",
data: JSON.stringify(pst),
dataType: "json",
success: function (json) {
console.log(json);
}
});