我正在研究 tincan JavaScript API。我的数据格式的问题是完全改变,TinCan 已经指定了为什么将数据与调用一起传递。帮助我以 TinCan Api 格式调整我的数据。这是我的电话之一的示例数据。
var data = {“groupId”:“groupId”,“groupName”:“gNameEncrypt”,“tutorNames”:“tutorNames”,“actorNames”:“actorNames”,“otherNames”:“otherNames”};
目前我在做什么我只是解码这些数据并像这样发送它。
var actionList = new TinCan(
{
recordStores: [{
endpoint: "http://example.com",
username: username,
password: password,
allowFail: false
}]
});
var action = new TinCan.Agent({
"name": "insert"
});
actionList.getStatements({
'params': {
'agent': action,
'verb': {
'id': $.base64.encode(data)
}
},
'callback': function (err, data) {
console.info(data.more);
var urlref = "http://<?php echo $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . $uriParts[0] . "?" ?>t=" + data.more.TutorToken;
window.location.href = urlref;
}
});
crypt.finish();
});