XML attribute to Webpage Request
This question already has an answer here:
var xml = new XMLHttpRequest();
xml.open('GET', 'some url', true);
xml.setRequestHeader('Authorization', auth); // <<<<----- USED HERE
xml.send();
You can do this way or your can also use jQuery ajax call
Update upon REQUEST:
var xml = new XMLHttpRequest();
xml.open('GET', 'http://URL:8080', true);
xml.setRequestHeader('Authorization', "BASIC eHh4Onl5eQ=="); // <<<<----- USED HERE
xml.send();
eHh4Onl5eQ==
is base64 encode form of username:password ie xxx:yyy. You can do the conversion online here.
Try it out, it's a pseudo code.
链接地址: http://www.djcxy.com/p/21926.html下一篇: XML属性到网页请求