1
0
mirror of https://gitee.com/openLuat/LuatOS synced 2025-08-17 22:18:03 +08:00

update: demo/wlan演示http的代码,若服务器返回的数据没有body,会报错

This commit is contained in:
Wendal Chen 2023-01-02 22:51:52 +08:00
parent dc9ec4ba49
commit ccf2660d89

View File

@ -36,7 +36,7 @@ sys.taskInit(function()
-- local url = "http://ip.nutz.cn/json"
local url = "http://nutzam.com/1.txt"
local code, headers, body = http.request("GET", url).wait()
log.info("http", code, json.encode(headers), #body)
log.info("http", code, json.encode(headers or {}), body and #body or 0)
else
print("wlan NOT ready!!!!")
end