from http://oyanglul.us

1 2 3 4 5 6 7 8 9 10 11 12 13 14
var Request = require("sdk/request").Request;
var request = function(url, method, data){
var res = $.Deferred();
Request({
url: url,
content: data,
onComplete: function (response) {
res.resovle(response.json);
}
})[method]();
return res;
}
 
module.exports = request
view raw moz-request.js hosted with ❤ by GitHub

oyanglulu
738 声望20 粉丝