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的更多相关文章

  1. Client JQuery invoke NetSuite Suitelet

    Please indicate the source if you need to repost. Client jQuery could initialize a cross-domain requ ...

  2. P/Invoke:C#调用C++

    P/Invoke的全称是Platform Invoke (平台调用) 它实际上是一种函数调用机制通 过P/Invoke我们就可以调用非托管DLL中的函数. P/Invoke依次执行以下操作: 1. 查 ...

  3. C# Invoke或者BeginInvoke的使用

    在Invoke或者BeginInvoke的使用中无一例外地使用了委托Delegate. 一.为什么Control类提供了Invoke和BeginInvoke机制? 关于这个问题的最主要的原因已经是do ...

  4. Invoke的使用情景

    直接看代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Dat ...

  5. 关于控件的Invoke(...)方法和BeginInvoke(...)方法的区别

    这两个方法最主要的区别就是一个是同步,一个是异步,即会阻塞线程,那么阻塞哪个线程呢?我们用代码来分析(工具是VS2010) using System; using System.Collections ...

  6. 多线程、委托、Invoke解决winform界面卡死的问题,并带开关

    一.知识点介绍 1,更新控件的内容,应该调用控件的Invoke方法. Invoke指: 在拥有控件的基础窗口句柄的线程上,用指定的参数列表执行指定委托.该方法接收一个委托类型和委托的参数,因此需要定义 ...

  7. NetSuite Chinese Finance Reports

    NetSuite has a strong report customization application. The standard finance reports has a different ...

  8. (转)C#为什么要使用Invoke,它和BeginInvoke有什么区别

    在Invoke或者BeginInvoke的使用中无一例外地使用了委托Delegate. 一.为什么Control类提供了Invoke和BeginInvoke机制? 关于这个问题的最主要的原因已经是do ...

  9. .NET学习之路----我对P/Invoke技术的理解(一)

    看了P/Invoke技术的介绍,于是想写下点东西,东西包含两个部分:知识的纪录和我的理解及疑问. r托管代码中调用非托管API函数的过程 1.定位包含API的DLL: 2.载入DLL 3.找到DLL中 ...

随机推荐

  1. jQuery不支持hashchange事件?

    $(window) .bind( 'hashchange', onHashchange ) .trigger( 'hashchange' ); jQuery版本是1.9.1的,去源码里没找到hashc ...

  2. ios UIButton设置单选效果,以及同时设置图片和标题

    一,设置单选效果 - (void)selectedBtnPress:(UIButton*)sender { //首先把原来按钮的选中效果消除 for (int i=0;i<num;i++) {/ ...

  3. CSS水平垂直居中的几种方法

    直接进入主题! 一.脱离文档流元素的居中 方法一:margin:auto法 CSS代码: div{ width: 400px; height: 400px; position: relative; b ...

  4. EF架构~在ef中支持IQueryable级别的Contains被翻译成了Exists,性能可以接受!

    回到目录 Entityframeworks很聪明 不错,非常不错!ef里的contains比linq to sql里的contains有了明显的提升,事实上,是在进行SQL语句翻译上有所提升,在lin ...

  5. 理解 Lua 的那些坑爹特性

    按:最近看到了依云的文章,一方面,为Lua被人误解而感到十分难过,另一方面,也为我的好友, 依云没有能够体会到Lua的绝妙和优雅之处而感到很遗憾,因此我写了这篇文章,逐条款地说明了 依云理解中出现的一 ...

  6. [Java类加载器]Java中classLoader浅析.

    本文为在公司内部TD上写的一篇小文, 主要讲解java中classLoader基础知识, 现在拿来这里分享一下. 一.问题 请在Eclipse中新建如下类,并运行它: 1 package java.l ...

  7. 加载的过程中图片变形了? --教你自定义自动适配图片宽高比的RatioLayout

    很多同行在开发中可能会遇到这样的问题,就是在加载图片的时候会出现图片变形的问题.其实这很可能就是你的图片宽高比和图片所在容器的宽高比不匹配造成的.比如说图片的宽为200,高为100.宽高比就是2,那么 ...

  8. JS中call、apply、bind使用指南,带部分原理。

    为什么需要这些?主要是因为this,来看看this干的好事. box.onclick = function(){ function fn(){ alert(this); } fn();}; 我们原本以 ...

  9. [software development] 需求分析checklist

    [software development] 需求分析checklist // */ // ]]>   [software development] 需求分析checklist Table of ...

  10. android 中resources管理

    主要存在于res/value文件夹中 定义: dimen.xml:主要用于设置像素默认值 <resources> res/values/dimens.xml <dimen name= ...