.NET invoke NetSuite Restlet
Please indicate the source if you need to repost.
Restlet allows programmers to use the http request instead of SuiteTalk.
Below is the sample code for .NET coder to begin with:
private void button1_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.
.NET invoke NetSuite Restlet的更多相关文章
- Client JQuery invoke NetSuite Suitelet
Please indicate the source if you need to repost. Client jQuery could initialize a cross-domain requ ...
- P/Invoke:C#调用C++
P/Invoke的全称是Platform Invoke (平台调用) 它实际上是一种函数调用机制通 过P/Invoke我们就可以调用非托管DLL中的函数. P/Invoke依次执行以下操作: 1. 查 ...
- C# Invoke或者BeginInvoke的使用
在Invoke或者BeginInvoke的使用中无一例外地使用了委托Delegate. 一.为什么Control类提供了Invoke和BeginInvoke机制? 关于这个问题的最主要的原因已经是do ...
- Invoke的使用情景
直接看代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Dat ...
- 关于控件的Invoke(...)方法和BeginInvoke(...)方法的区别
这两个方法最主要的区别就是一个是同步,一个是异步,即会阻塞线程,那么阻塞哪个线程呢?我们用代码来分析(工具是VS2010) using System; using System.Collections ...
- 多线程、委托、Invoke解决winform界面卡死的问题,并带开关
一.知识点介绍 1,更新控件的内容,应该调用控件的Invoke方法. Invoke指: 在拥有控件的基础窗口句柄的线程上,用指定的参数列表执行指定委托.该方法接收一个委托类型和委托的参数,因此需要定义 ...
- NetSuite Chinese Finance Reports
NetSuite has a strong report customization application. The standard finance reports has a different ...
- (转)C#为什么要使用Invoke,它和BeginInvoke有什么区别
在Invoke或者BeginInvoke的使用中无一例外地使用了委托Delegate. 一.为什么Control类提供了Invoke和BeginInvoke机制? 关于这个问题的最主要的原因已经是do ...
- .NET学习之路----我对P/Invoke技术的理解(一)
看了P/Invoke技术的介绍,于是想写下点东西,东西包含两个部分:知识的纪录和我的理解及疑问. r托管代码中调用非托管API函数的过程 1.定位包含API的DLL: 2.载入DLL 3.找到DLL中 ...
随机推荐
- Flash AS实现时钟效果(全脚本实现)
最近工作中用到个Flash效果,好久没有写FlashAS脚本了,就想从以前写的代码中找一些实例.竟然看到硬盘中还留有若干年前的代码. 这个时钟效果是全部采用脚本实现,图形也是用脚本绘制的.写于2005 ...
- zk系列-zookeeper的使用
zk支持java/c访问,java常用的有apache-zkclient.社区版的i0tec-zkclient.github.adyliu,apache-zkclient是zk自身提供的接口,i0te ...
- i++ and ++i efficiency
其实这个问题,百度的话,有一大堆的参考资料,但是,在这里,我产生了一些困惑,他们所分析的结果,和我的测试代码不一致,这让我纠结了,所以,再次的写一下这个问题,顺顺思路. 我的测试环境:系统:Windo ...
- hibernate继承(转)
http://justsee.iteye.com/blog/1070588 一.继承关系_整个继承树映射到一张表 对象模型(Java类结构) 一个类继承体系一张表(subclass)(表结构) Emp ...
- C#设计模式-工厂模式
引入人.工厂.和斧子的问题 原始社会时,劳动社会基本没有分工,需要斧子的人(调用者)只好自己去磨一把斧子,每个人拥有自己的斧子,如果把大家的石斧改为铁斧,需要每个人都要学会磨铁斧的本领,工作效率极低. ...
- WebBrowser设置Cookie
在winform里面经常会用到WebBrowser,这是一个难点就是如何设置cookies,注意,Docment对象是只读的,所以WebBrowser.Docment.cookie也就只有get方法, ...
- java三大循环:for、while、do...while
1.while和do...while的区别: while 与 do...while之间的区别:如果布尔表达式第一次执行的结果就为false,那么while循环一次也不执行:do...while循环会执 ...
- Android入门(十二)SQLite事务、升级数据库
原文链接:http://www.orlion.ga/610/ 一.事务 SQLite支持事务,看一下Android如何使用事务:比如 Book表中的数据都已经很老了,现在准备全部废弃掉替换成新数据,可 ...
- Linq(一)
Linq是c#设计者们在c#3.0中新添加的语法:查询表达式.使用查询表达式,很多标准查询操作符都能转化成更容易理解的代码,也就是和SQL风格非常接近的代码. 在介绍Linq之前,先介绍下泛型集合IE ...
- C#预处理器指令 ,你造吗??? (●'◡'●)
什么是c#预处理指令?? 用于在 C# 源代码中嵌入的编译器命令. C#预处理器指令有哪些?? ↓↓↓这些就是预处理器指令啦 下面我们一一道来(●'◡'●) 1.#if ,#elif,#else,en ...