C.Neal
C.Neal

Reputation: 329

What is the SuiteScript 2.0 equivalent to nlapiRequestURL()?

Does anyone know the SuiteScript 2.0 equivalent?

nlapiRequestURL(url, postdata, headers, httpMethod)

Upvotes: 6

Views: 2735

Answers (1)

prasun
prasun

Reputation: 7343

http and https modules are equivalent of nlapiRequestURL()

HTTP SIMPLE EXAMPLE

var response = http.get({
    url: 'http://www.google.com',
    headers: headers
});

var response = https.post({
    url: 'http://www.google.com',
    body: myPostDataObj,
    headers: headers
});

HTTPS EXAMPLE

 var response = https.get({
     url: url,
     headers: headers
 });

Upvotes: 12

Related Questions