Lua · Variables · Storage and web
http
Fetch data from adolfjon.uz.
| Function | What it does |
|---|---|
http.get(url, callback) network | Starts a GET request on a worker thread. The callback runs later on the render thread. |
#http.get
http.get(url, callback)Starts a GET request on a worker thread. The callback runs later on the render thread.
Changing a value needs the network permission (Use the internet). Without it the call returns the current value and logs
needs permission: network once. How permissions workArguments
urlstringMust start with
https://adolfjon.uz/.callbackfunction(ok, body)ok is false when the connection failed. The HTTP status is not passed, so check the body.
Returns
boolean
false when not allowed or 4 requests are already running.
- Replies are cut at about 512 KB.
Example
http.get("https://adolfjon.uz/storage/uploads/white.png", function(ok, body)
if ok then logo = draw.load_image_data(body) end
end)