Thanks for the idea. AHR can now be used exactly like `request` in node and the browser.
var request = require('ahr');
request(options, callback);
In fact, I added request's test cases to my own.
Here's an example of other features and how to join them together.
request.join(
request({ uri: '/local-contacts' }),
request.get("/local-contacts", params, options),
request.jsonp(FacebookContacts, "jsoncallback", params, options),
request.jsonp(TwitterContacts, "callback", params)
).when(function (fbcResp, tcResp) {
var fbc, tc;
fbc = { err: fbcResp[0], xhr: fbcResp[1], data: fbcResp[2] };
tc = { err: tcResp[0], xhr: tcResp[1], data: tcResp[2] };
if (fbc.err || tc.err) {
console.log(fbc.err);
console.log(tc.err);
}
});
http://github.com/coolaj86/abstract-http-request
AJ ONeal
(317) 426-6525
On Fri, Oct 29, 2010 at 11:28 AM, Charlie Robbins
<charlie...@gmail.com> wrote:
Neat. Like the cross-platform aspects to the library. Have you considered being more consistent with the new 'request' APIs that are being discussed going into core? The code currently exists here: http://github.com/mikeal/node-utils/tree/master/request/ With the feature branch here: http://github.com/mikeal/node/tree/http-request-merge
-Charlie
Changed the URL:
http://github.com/coolaj86/abstract-http-requestJSONP is now working for both node and the browser. jQuery is no longer required, but will be used if available.
Other methods appear to be working just fine as per firebug.
AJ ONeal
ahr.get(flickApi, {tags: "cat", tagmode: "any"})
.when(function (err, data, xhr) {
// do stuff
});
There are a few easy-to-fix quirks that I'll be working out as I develop with this over the next few days, but I wanted to go ahead and get it out tonight.
AJ ONeal
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.