XML attribute to Webpage Request

This question already has an answer here:

  • JavaScript post request like a form submit 26 answers

  • 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

    上一篇: 使用Flask从HTML表单发布一个对象数组?

    下一篇: XML属性到网页请求