Ultimate XHR solution, for me.
Install with component(1):
$ component install shallker/http
var HTTP = require('http');
var http = new HTTP;
f(http.url)
f(http.header)
f(http.data)
f(http.method)
f(http.on)
f(http.off)
f(http.complete)
f(http.success)
f(http.fail)
f(http.POST)
f(http.GET)
f(http.request)
ok(http.on('complete', function () { log('complete') }))
ok(http.on('success', function () { log('success') }))
ok(http.on('fail', function () { log('fail') }))
ok(http.on(200, function () { log(200) }))
ok(http.on('Ok', function () { log('Ok') }))
ok(http.on(304, function () { log(304) }))
ok(http.on('Not Modified', function () { log('Not Modified') }))
ok(http.GET('http://lc:3000/test/http.js', function () { log('done') }))
MIT