1 Star 2 Fork 4

杰神 / iot-master-gateway-luat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
http.lua 712 Bytes
一键复制 编辑 原始数据 按行查看 历史
module(..., package.seeall)
require "http"
local function cbFnc(result,prompt,head,body)
log.info("testHttp.cbFnc",result,prompt)
if result and head then
for k,v in pairs(head) do
log.info("testHttp.cbFnc",k..": "..v)
end
end
if result and body then
log.info("testHttp.cbFnc","body="..body)
end
-- todo 上传失败,缓存再上传
end
http.request("POST", -- method
"36.7.87.100:6500", -- url
nil, -- cert
{
['Content-Type'] = "application/json"
}, -- headers
{
[1] = "begin\r\n",
[2] = {
file = "/lua/http.lua"
},
[3] = "end\r\n"
}, -- content
30000, -- timeout
cbFnc) -- cb
Lua
1
https://gitee.com/god-jason/iot-master-gateway-luat.git
git@gitee.com:god-jason/iot-master-gateway-luat.git
god-jason
iot-master-gateway-luat
iot-master-gateway-luat
main

搜索帮助