. NET invoke NetSuite Restlet, netsuiterestlet

Source: Internet
Author: User

. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.