|
|
@@ -30,13 +30,13 @@ local function connectWifi()
|
|
|
end
|
|
|
|
|
|
local function requestHttp()
|
|
|
- local rd = {}
|
|
|
- while 1 do
|
|
|
- local code, headers, body = http2.request("GET","http://apicn.luatos.org:23328/luatos-calendar/v1?mac=111&battery=10&location="..location.."&appid="..appid.."&appsecret="..appsecret).wait()
|
|
|
- if code == 200 then
|
|
|
- return body
|
|
|
- end
|
|
|
+ local code, headers, body = http2.request("GET","http://apicn.luatos.org:23328/luatos-calendar/v1?mac=111&battery=10&location="..location.."&appid="..appid.."&appsecret="..appsecret).wait()
|
|
|
+ if code == 200 then
|
|
|
+ return body
|
|
|
+ else
|
|
|
+ log.info("http get failed",code, headers, body)
|
|
|
sys.wait(500)
|
|
|
+ return ""
|
|
|
end
|
|
|
end
|
|
|
|