---@meta -- Generated from native/src/bindings/core/http.cpp. Do not edit. ---@class HttpRequestOptions ---@field maxBytes integer Maximum response-body bytes to allocate, up to http.MAX_RESPONSE_BYTES; zero is valid for HEAD. ---@field headers? table ---@class HttpResponse ---@field status integer HTTP status code. ---@field body string Response body, including for non-2xx responses. ---@class HttpDownloadOptions ---@field maxBytes integer Required maximum, from 1 through 16777216. ---@field expectedSize? integer Exact expected byte count. ---@field sha256? string Exact expected SHA-256 as 64 hexadecimal characters. ---@class HttpLib ---@field MAX_RESPONSE_BYTES integer Largest portable in-memory response body. http = {} http.MAX_RESPONSE_BYTES = 65536 ---Performs a GET request. ---@param url string ---@param options HttpRequestOptions ---@return HttpResponse? response ---@return string? error Transport failure or response body exceeding maxBytes. function http.get(url, options) end ---Performs a HEAD request. ---@param url string ---@param options HttpRequestOptions ---@return HttpResponse? response Body is empty. ---@return string? error function http.head(url, options) end ---Performs a DELETE request. ---@param url string ---@param options HttpRequestOptions ---@return HttpResponse? response ---@return string? error function http.delete(url, options) end ---Performs a POST request. ---@param url string ---@param body string ---@param options HttpRequestOptions ---@return HttpResponse? response ---@return string? error function http.post(url, body, options) end ---Performs a PATCH request. ---@param url string ---@param body string ---@param options HttpRequestOptions ---@return HttpResponse? response ---@return string? error function http.patch(url, body, options) end ---Streams authenticated HTTPS to a new file and removes partial or unverified output. ---@param url string HTTPS URL. ---@param destination string Absolute path which must not exist. ---@param options HttpDownloadOptions ---@return integer? bytesWritten ---@return string? error function http.download(url, destination, options) end ---Percent-encodes a string for use in a URL. ---@param input string ---@return string function http.urlencode(input) end