main.lua 293 B

12345678910
  1. _G.sys = require("sys")
  2. sys.taskInit(function()
  3. sys.wait(1000)
  4. log.info("http_timeout", "start", "5s timeout test")
  5. local code, headers, body = http.request("GET", "http://httpbin.air32.cn/delay/10", {timeout=5000}).wait()
  6. log.info("http_timeout", code, body)
  7. end)
  8. sys.run()