你的位置:首页 > 软件开发 > ASP.net > .NET invoke NetSuite Restlet

.NET invoke NetSuite Restlet

发布时间:2016-05-30 19:00:12
Please indicate the source if you need to repost.Restlet allows programmers to use the http request instead of SuietTalk.Below is the sample ...

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 with:

.NET invoke NetSuite Restlet.NET invoke NetSuite Restlet
    private void button1_Click(object sender, EventArgs e)    {      get='_blank'>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 invoke NetSuite Restlet

关键词:.NET

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。