I'm using pure javascript to send an AJAX with the Access_token header with a key inside, because web-service requests this request ... but it's not going as I would like.
I want it to look like this:
Butit'sgettinglikethis:
Here's my function: function function () {
var xmlhttp;
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST","https://www.asaas.com/api/v1/customers?name=Lucas",true);
xmlhttp.setRequestHeader('Access_token', 'bdb4b600eee96f16bf118c617a65561eba06629525c07f6564b9531a38959468');
xmlhttp.setRequestHeader('Content-Type', 'application/json');
xmlhttp.onreadystatechange = handler;
xmlhttp.send();
}