跳到主要内容

HTTP 节点(type = "http")

用于调用外部 HTTP 服务。

Schema

  • 参考: HttpNode.json
  • 核心字段:
    • data.api.method:HTTP 方法(GET/POST/PUT/DELETE 等)
    • data.api.url:URL 模板(支持 {{start_0.path}} 这类模板变量)
    • data.body:请求体(JSON / TEXT / FORM 等)
    • data.headersValues / data.paramsValues:支持 ref / constant / expression
    • data.outputs:常见输出为 body / headers / statusCode

示例

把 Start 的 query 作为参数调用外部接口:

{
"nodes": [
{
"id": "start_0",
"type": "start",
"data": { "outputs": { "type": "object", "properties": { "query": { "type": "string" } } } }
},
{
"id": "http_0",
"type": "http",
"data": {
"title": "HTTP",
"api": {
"method": "GET",
"url": { "type": "constant", "content": "https://example.com/search" }
},
"paramsValues": {
"q": { "type": "ref", "content": ["start_0", "query"] }
}
}
}
],
"edges": [{ "sourceNodeID": "start_0", "targetNodeID": "http_0" }]
}