我正在尝试创建一个使用表单数据的http get节点,然后使用rest API将http发布到另一个网站。我能够获得http调用以返回正确的有效负载,但是http响应节点在调试选项卡中给出了“无响应对象”错误,并且客户端从不返回。我是否特别需要做一些事情来传递响应对象,以便调用将正确的响应对象发送到http响应节点?
流程如下:[{“ id”:“ 7011e7a9.8fee18”,“ type”:“ http request”,“ name”:“”,“ method”:“ use”,“ ret”:“ obj”,“ url“:”“,” x“:499,” y“:84,” z“:” 51693a88.ae96c4“,”电线“:[[” efea497c.1015b8“]]},{” id“:” 589f2a18 .a760d4“,”类型“:”函数“,”名称“:”“,” func“:” var myprocess = context.global.process; \ nmyprocess.env.NODE_TLS_REJECT_UNAUTHORIZED = \“ 0 \”; \ nvar dev_url = \“ https://website.com:22411/central/api/qracore/browses?browseId=mfg:gp239\“; \ n \ nvar msg = {\ n \” method \“:\” GET \“,\ n \” url \“:dev_url,\ n \” headers \“:{\ n \” Authorization \“ :\“ Basic abWZnQHFhZC5jb206 = \”,\ n \“来源\”:\“ mybox.com \” \ n} \ n}; \ n \ nreturn msg;“,”输出“:1,” noerr“:0 ,“ x”:323,“ y”:154,“ z”:“ 51693a88.ae96c4”,“电线”:[[“” 7011e7a9.8fee18“]]}},{” id“:” 9f65b624.609a48“,”类型“:”调试“,”名称“:”“,”活动“:true,”控制台“:” false“,”完成“:”有效载荷“,” x“:810,” y“:211,” z “:” 51693a88.ae96c4“,”电线“:[]},{” id“:” 38e4c04d.c71b4“,”类型“:”http in“,” name“:”“,” url“:” / workOrders“,” method“:” get“,” swaggerDoc“:”“,” x“:152,” y“:190,” z“ :“ 51693a88.ae96c4”,“电线”:[[“” 589f2a18.a760d4“]]},{” id“:” e5ee54b2.1a11a8“,” type“:” http响应“,” name“:”“,” x“:770,” y“:96,” z“:” 51693a88.ae96c4“,”电线“:[]},{” id“:” efea497c.1015b8“,”类型“:”功能“,”名称“:”“,” func“:” var newMsg = {负载:msg.payload}; \ nreturn newMsg;“,”输出“:1,” noerr“:0,” x“:582,” y“:214 ,“ z”:“ 51693a88.ae96c4”,“导线”:[[“ e5ee54b2。1a11a8“,” 9f65b624.609a48“]]}]
关键是将其从节点传递到另一个节点。您可以通过使用msg的req和res传递给输出来实现。
var newMsg = { payload: msg.payload }; //return [msg, newMsg]; newMsg.user = msg.req.body["user"]; newMsg.req = msg.req; newMsg.res = msg.res; return newMsg;