battk
05/01/2020, 9:56 AM/**
*@NApiVersion 2.1
*@NScriptType Suitelet
*/
define(["N/http"], function (http) {
function onRequest(context) {
log.debug({
title: "onRequest started at",
details: new Date(),
});
log.debug({
title: "http get started at",
details: new Date(),
});
http.get
.promise({
url:
"<http://slowwly.robertomurray.co.uk/delay/4000/url/http://google.com>",
})
.then(function (response) {
log.debug({
title:
"http get ended at (should be around 4 seconds after it started)",
details: new Date(),
});
});
log.debug({
title: "onRequest ended at",
details: new Date(),
});
}
return {
onRequest: onRequest,
};
});