screnshaw
10/29/2021, 7:14 PMfkrauthan
10/29/2021, 7:15 PMN/url
resolveScript to find the internal URL to your restlet by scriptid/deploymentid and using N/https
should take care of authentication in my experience.screnshaw
10/29/2021, 7:16 PMvar restletUrl = url.resolveScript({
params:{Authorization: context.request.headers.Authorization},
scriptId: 'customscript_ad_rl_query',
deploymentId: 'customdeploy_ad_rl_query',
returnExternalUrl: false
});
var response = <http://https.post|https.post>({
url: restletUrl,
body: context.request.body
});
MTNathan
10/29/2021, 7:24 PMurl.resolveScript()
only resolves a relative url, you'll also need to add the domain to that before using it with <http://https.post|https.post>()
. I'd suggest using url.resolveDomain()
for getting the domain, but you can also hard-code it if you're only running this script in one account (or at least for a quick test).screnshaw
10/29/2021, 7:30 PMMTNathan
10/29/2021, 7:49 PMhttps.requestRestlet()
.screnshaw
10/29/2021, 7:50 PMMTNathan
10/29/2021, 7:56 PMscrenshaw
10/29/2021, 8:17 PMscrenshaw
10/29/2021, 8:17 PMfkrauthan
10/29/2021, 10:28 PMparams
and returnExternalUrl
from resolveUrlfkrauthan
10/29/2021, 10:28 PMfkrauthan
10/29/2021, 10:28 PMfkrauthan
10/29/2021, 10:29 PM