isv-http
Version:
a simple http for isv-gallery-kissy
27 lines (23 loc) • 879 B
JavaScript
var request = require('request');
exports.getCompileCajoledCode = function (content, name, cb) {
request.post("http://zxn.taobao.com/tbcajaService.htm", {form: {
token: 'TAE-SDK',
content: content,
component: name
}},
function (error, response, body) {
if (!error && response.statusCode == 200) {
body = body.substring(body.indexOf('TShop'));
body = body.replace(/'/g, "'");
body = body.replace(/"/g, '"');
body = body.replace(/&/g, '&');
body = body.replace(/</g, '<');
body = body.replace(/>/g, '>');
body = body.replace(/\\\\\"/g, "\\\"");
if (cb) {
cb(body);
}
}
}
);
};