dockerized_openAger/nodered/rootfs/data/node_modules/xmlhttprequest-ssl/example/demo.js

17 lines
403 B
JavaScript
Raw Permalink Normal View History

2020-10-17 16:42:50 +00:00
var sys = require('util');
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
sys.puts("State: " + this.readyState);
if (this.readyState == 4) {
sys.puts("Complete.\nBody length: " + this.responseText.length);
sys.puts("Body:\n" + this.responseText);
}
};
xhr.open("GET", "http://driverdan.com");
xhr.send();