shubs
04/10/2019, 9:26 PMbattk
04/10/2019, 9:28 PMbattk
04/10/2019, 9:28 PMvar response = <http://https.post|https.post>({
url: "<https://httpbin.org/post>",
body: {key:'value'}
});
log.debug("body", response.body);
jeffmillies
04/10/2019, 9:29 PMshubs
04/10/2019, 9:35 PM/**
*@NApiVersion 2.x
*@NScriptType Suitelet
*@NModuleScope Public
*/
require(['N/https','N/log'], function (https,log){
function doPost(){
var response = <http://https.post|https.post>({
url : "<https://postman-echo.com/post>",
body : {foo : 'bar'}
});
log.debug("body", response.body);
}
});
battk
04/10/2019, 9:36 PMerictgrubaugh
04/10/2019, 9:36 PMerictgrubaugh
04/10/2019, 9:37 PMdoPost()
function, just start with the <http://https.post|https.post>()
callerictgrubaugh
04/10/2019, 9:37 PMlog.debug()
won't go anywhere without a script deploymentshubs
04/10/2019, 9:38 PMerictgrubaugh
04/10/2019, 9:38 PMbattk
04/10/2019, 9:38 PMerictgrubaugh
04/10/2019, 9:38 PMbattk
04/10/2019, 9:39 PMrequire(["N/https", "N/log"], function(https, log) {
var response = <http://https.post|https.post>({
url: "<https://postman-echo.com/post>",
body: { foo: "bar" }
});
log.debug("body", response.body);
});
shubs
04/10/2019, 9:42 PMshubs
04/10/2019, 9:43 PM{
"args": {},
"data": "",
"files": {},
"form": {
"foo": "bar"
},
"headers": {
"x-forwarded-proto": "https",
"host": "<http://postman-echo.com|postman-echo.com>",
"content-length": "7",
"accept": "text/*",
"accept-encoding": "gzip, deflate",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"user-agent": "NetSuite/2018.2 (SuiteScript)",
"x-forwarded-port": "443"
},
"json": {
"foo": "bar"
},
"url": "<https://postman-echo.com/post>"
}
ec
04/10/2019, 10:22 PMshubs
04/10/2019, 10:23 PMshubs
04/11/2019, 1:06 PM