有人可以解释我们如何致电Suiteletfrom RESTlet
?
代码段是:
serverResponse.sendredirect({
type: 'SUITLET',
identifier: 'customscript_sample_rl_cals_sl',
id: 'customdeploy_sample_rl_cals_sl'
});
但是我在使用https模块时无法找到RESTlet中的serverResponse,有人可以帮忙吗?
答案 0 :(得分:2)
以下是如何在RESTlet中调用Suitelet。您的Suitelet必须无需登录即可使用。在此示例中,https模块变量称为HTTPSMODULE:
var myRequest = {};
myRequest.headers = {};
myRequest.headers["User-Agent"] = "Mozilla/5.0";
myRequest.url = 'https://XXXXXXXXX'; //Suitelet External URL
var myResponse = HTTPSMODULE.get(myRequest);