http.http.get
Declaration
lua
http.get(url [, timeout, headers, noEscape])
Description
HTTP GET request. Named args: http.get{url=, timeout=, headers=, params=, download_file=}.
Parameters
`url` (string)
`timeout` (number, optional, default 10)
`headers` (table, optional)
`noEscape` (boolean, optional)
Return Values
`number` code (-1 on timeout)
`string` headersJson
`string` body
Example
lua
local code, headers, body = http.get("https://api.example.com/data")
local code, h, body = http.get{url="https://api.com", headers={["Auth"]="Bearer xxx"}}