🌐HTTP
Table to work with HTTP requests.
Request(method: string
, url: string
, data [?]
: {headers:table<string>, cookies:string|table<string>, data:string|table<string>}
, callback: fun(tbl: {response: string, code: string, header: string, param: string}):nil
, param [?]
: string
): boolean
string
, url: string
, data [?]
: {headers:table<string>, cookies:string|table<string>, data:string|table<string>}
, callback: fun(tbl: {response: string, code: string, header: string, param: string}):nil
, param [?]
: string
): boolean
Name
Type
Description
method
string
HTTP method
url
string
URL
data [?]
{headers:table<string>, cookies:string|table<string>, data:string|table<string>}
data to send (default: {})
callback
fun(tbl: {response: string, code: string, header: string, param: string}):nil
callback function to call when request is done. Take 1 argument - response data table, see example.
param [?]
string
string parameter to pass to callback function to identify request (default: "")
Do HTTP request. Returns true
if request was sent successfully.
Example
Last updated