aboutsummaryrefslogtreecommitdiffhomepage
path: root/node_modules/xmlhttprequest-ssl/example
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/xmlhttprequest-ssl/example')
-rw-r--r--node_modules/xmlhttprequest-ssl/example/demo.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/node_modules/xmlhttprequest-ssl/example/demo.js b/node_modules/xmlhttprequest-ssl/example/demo.js
new file mode 100644
index 0000000..4f333de
--- /dev/null
+++ b/node_modules/xmlhttprequest-ssl/example/demo.js
@@ -0,0 +1,16 @@
+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();