Modules
Objects/Functions
SuiteScript 2.0
{https}.requestRestlet({body: {string | Object},deploymentId: {string*},scriptId: {string | number*},headers: {Object},method: {string},urlParams: ${7:Object}})
N/https Module
https.requestRestlet()
Method Description:
Sends an HTTPS request to a RESTlet and returns the response. Authentication headers are automatically added.
The RESTlet will run with the same privileges as the calling script.
Returns:
https.ClientResponse
Supported Script Types:
Server scripts
For more information, see SuiteScript 2.0 Script Types.
Governance:
10 units
Module:
N/https Module
Since:
2020.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=https.requestRestlet(options)
Example:
// Code Example 1
// Add additional code
//...
var myRestletHeaders = {
myHeaderType: 'Test',
myHeaderStuff: 'This is my header',
myHeaderId: 7
};
var myUrlParameters = {
myFirstParameter: 'firstparam',
mySecondParameter: 'secondparam'
}
var myRestletResponse = https.requestRestlet({
body: 'My Restlet body',
deploymentId: 'deploy1',
headers: myRestletHeaders,
method: 'GET',
scriptId: 99,
urlparams: myUrlParameters
});
Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159139340774.html