Skip to content

Lua API Network

Leonard Ramminger edited this page Aug 10, 2026 · 1 revision

Lua API — Network (beez.net)

HTTP client (libcurl) for REST, downloads, and connectivity checks.

REST response shape

Every REST call returns:

FieldTypeDescription
statusnumberHTTP status
bodystringresponse body
okbooleantrue for 2xx
headerstablelowercase header names
errorstring?transport error message

Functions

FunctionDescription
get(url, [headers])HTTP GET
post(url, body, [headers])HTTP POST
put(url, body, [headers])HTTP PUT
delete(url, [headers])HTTP DELETE
request(method, url, options)arbitrary method; options.body, options.headers, options.timeout, options.follow_redirects
upload(url, file_path, [headers])multipart POST
download(url, dest, [options])save to file → { path, bytes }
download_and_verify(url, dest, algo, hash, [options])download + hash check
ping(url, [timeout]){ ok, status, ms, error? }
is_online([timeout])boolean probe
set_proxy(url) / set_proxy(nil)process-wide proxy

Headers

localheaders= {
["Content-Type"] ="application/json",
Authorization="Bearer " ..token,
}
localres=beez.net.get("https://api.example.com/v1/status", headers)

← Lua API Overview

Clone this wiki locally