因此,我尝试使用lua(HTTPGET)接收来自pipedream工作流的客户端IP之类的数据。因此,我在Node.JS中有一个自定义的正文响应,没有错误。但是,当我在Lua中打印body响应时,我得到了这个不寻常的错误。它会打印ip,但随后显示错误的数字位于客户端ip附近。:
我的pipedream的Node.JS代码:
await $respond({
status: 200,
immediate: true,
body: `${steps.trigger.event.client_ip}`
})没有错误,它很好,但这是我的Lua代码来获得响应:
function GetServProtocal()
print(loadstring(game:HttpGet('https://enznhjjype22xb2.m.pipedream.net')))()
end
GetServProtocal()此外,没有错误,但输出很奇怪:
-- I'm using 1.1.1.1 example ip for code so I don't expose my real one.
[string "1.1.1.1"]:1: malformed number near "1.1.1.1"发布于 2021-07-30 06:20:36
从代码中删除loadstring。loadstring函数需要一些Lua代码,它会将这些代码转换为可执行函数,而HttpGet返回的字符串不是有效的Lua代码,因此会出现错误。
https://stackoverflow.com/questions/68584988
复制相似问题