I'm cant understand how to user authorization headers in vanila javascript.
guide magento rest-api (oAuth 1.0), https://github.com/nickvane/Magento-RestApi/wiki/Authentication-steps.
how i implement this headers in my code: POST /oauth/initiate
Authorization: OAuth oauth_callback="http%3A%2F%2Flocalhost%3A8888",oauth_consumer_key="YOUR-CONSUMER-KEY",oauth_nonce="t02auly6elcuthly",oauth_signature="7FMe1UducbDUgCJWQY4Avv3g3f4%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1371098086",oauth_version="1.0"
my code:
var ajax = new XMLHTTPREQUEST();
ajax.open('POST', myurl+'/oauth/initiate',true);
ajax.send();
ajax.onreadystatechange = function(){
if(ajax.readyState == 4 ){
console.log(ajax.responseText);
}
}
how i can add headers like this to my code?