pub fn http_request_impl(
lua: &Lua,
args: (String, String, Option<Table>),
) -> Result<Table>Expand description
Executes an HTTP request using ureq. Called from capability-gated context.
§Arguments (from Lua)
method- HTTP method: “GET”, “POST”, “PUT”, “DELETE”, “PATCH”, “HEAD”url- Request URL (must be http:// or https://)opts- Optional table:headers- Table of {name = value} pairsbody- Request body stringtimeout- Timeout in seconds (default: 30)
§Returns (Lua table)
ok- boolean, true if HTTP response received (even 4xx/5xx)status- HTTP status code (number)headers- Response headers as {name = value} tablebody- Response body as stringerror- Error message (only when ok=false)error_kind- Error classification: “timeout”, “dns”, “connection_refused”, “tls”, “too_large”, “invalid_url”, “network”, “unknown”