Update carrack.js so it can put Authentication
This commit is contained in:
parent
7f77ad39bf
commit
ef0e47d7f5
@ -1,7 +1,8 @@
|
|||||||
function sendHttpRequest(url, method, data, callback, contentType = "multipart/form-data") {
|
function sendHttpRequest(url, method, data, callback, contentType = "multipart/form-data", authorization = "") {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open(method, url, true);
|
xhr.open(method, url, true);
|
||||||
xhr.setRequestHeader("Content-Type", contentType);
|
xhr.setRequestHeader("Content-Type", contentType);
|
||||||
|
xhr.setRequestHeader("Authorization", authorization);
|
||||||
xhr.onreadystatechange = function () {
|
xhr.onreadystatechange = function () {
|
||||||
if (xhr.readyState === 4) {
|
if (xhr.readyState === 4) {
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
|
Loading…
Reference in New Issue
Block a user