xplugin-nextcode
Version:
50 lines (48 loc) • 1.13 kB
JavaScript
const util = require("../../../util/util");
const schema = {
"node": {
"title": "节点属性",
"type": "object",
"properties": {
"url": {
"title": "URL",
"type": "string",
}
}
},
"input": {
"type": "object",
"title": "节点入参",
"properties": {
"_inputJson": {
"title": "入参JSON",
"type": "string",
"format": "textarea",
},
}
},
"output": {
"type": "object",
"title": "节点出参",
"properties": {
"_outputJson": {
"title": "出参JSON",
"type": "string",
"format": "textarea",
}
}
}
}
/**
* http.post
*/
async function post(node, input, engine) {
var result = util.parse(node, input);
var output = await engine.pluginAdapter.plugin.http.httpPost(result.url, result.param);
return output;
}
module.exports = {
"service": "post",
"implement": post,
"schema": schema,
}