Wednesday, June 19, 2019

Sample Perl Code to call RESTlet

Below is a PERL snippet for invoking NetSuite RESTlets:

# define the HTTP header
my $objHeader = HTTP::Headers->new;
my $deploymentURL =
$objHeader->push_header('Authorization' => "NLAuth
nlauth_account=$account, nlauth_email=$email,
nlauth_signature=$password, nlauth_role=$role");
$objHeader->push_header('Content-Type' => 'application/json');
# make the call
my $objRequest = HTTP::Request->new("POST",$deploymentURL,$objHeader,$request);

$account - NetSuite account number
$email - user's email
$password - user's password
$role - user's role

No comments:

Post a Comment