You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
403 B

7 years ago
  1. var sys = require('util');
  2. var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
  3. var xhr = new XMLHttpRequest();
  4. xhr.onreadystatechange = function() {
  5. sys.puts("State: " + this.readyState);
  6. if (this.readyState == 4) {
  7. sys.puts("Complete.\nBody length: " + this.responseText.length);
  8. sys.puts("Body:\n" + this.responseText);
  9. }
  10. };
  11. xhr.open("GET", "http://driverdan.com");
  12. xhr.send();