Send XML Http Request - Node.js Network

Node.js examples for Network:Ajax

Description

Send XML Http Request

Demo Code


function sendXMLHttpRequest (url) {
    var xhr = new XMLHttpRequest();
    xhr.open("GET", url, true);
    // xhr.setRequestHeader(name, value);
    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4) {
            console.log(xhr.responseText);
        }//from   w ww .  j  av  a2s.c  om
    }
    xhr.send();
}

Related Tutorials