Created
July 16, 2018 12:35
-
-
Save vladimirmyshkovski/7556079647644a0ab9a16e9674d624db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var testVar; | |
xmlhttp.onreadystatechange = function(){ | |
if (xmlhttp.readyState == 4 && (xmlhttp.status == 200 || xmlhttp.status == 201)){ | |
testVar = xmlhttp.responseText | |
} | |
} | |
xmlhttp.open(String(method), url, true); | |
xmlhttp.setRequestHeader("Content-Type", "application/json"); | |
xmlhttp.setRequestHeader("Authorization", "Token {{ token }}"); | |
xmlhttp.send(data); | |
console.log(testVar); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment