. NET invoke NetSuite Restlet, netsuiterestlet
Please indicate the source if you need to repost.
Restlet allows programmers to use the http request instead of SuietTalk.
Below is the sample code for. NET coder to begin:
Private void button#click (object sender, EventArgs e) {string myUrl = your_restlet_url; HttpWebRequest request = HttpWebRequest. create (myUrl) as HttpWebRequest; request. contentType = "application/json"; // Account: setup> integration> Web Services Preferences: Account ID // Email: your NetSuite login email // Signature: netSuite login password // Role: admin = 3 request. headers. add ("Authorization: NLAuth nlauth_account = 1005259, nlauth_email = xxx@netsuite.com, nlauth_signature =, nlauth_role = 3"); request. method = "POST"; string myParam = "{\" mydata1 \ ": 1234, \" mydata2 \ ": 2345}"; using (var streamWriter = new StreamWriter (request. getRequestStream () {streamWriter. write (myParam);} HttpWebResponse response = request. getResponse () as HttpWebResponse ;}. NET Sample Code
Below is the sample code of Restlet:
Function restlets_post (datain) {try {nlapiLogExecution ('debug', 'restlets _ get', datain. mydata2); var mystring = '{"data1": 123, "data2": 234}'; var myJson = parseJSON (mystring); return myJson;} catch (ex) {nlapiLogExecution ('debug', 'restlets _ Post', ex );}}Restlet Code
Hope it helps the life of SuiteTalk developer.