Skip to content

Instantly share code, notes, and snippets.

@tediscript
Created March 1, 2012 10:17
Show Gist options
  • Save tediscript/1948757 to your computer and use it in GitHub Desktop.
Save tediscript/1948757 to your computer and use it in GitHub Desktop.
Restler wrapper
var sys = require('util'),
rest = require('restler');
exports.hello = function() {
return 'hae';
};
exports.get = function(url, callback){
rest.get(url).on('complete', function(result) {
callback(result);
});
};
exports.post = function(url, params, callback) {
rest.post(url, params).on('complete', function(data, response) {
callback(data, response);
});
};
exports.del = function(url, callback){
rest.del(url).on('complete', function(result) {
callback(result);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment