How To Call It
This is an object method: call it with a colon on a request object created with Request(url) (request:<method>(...)). The global Request table does not have this method.
Returns the cookies added to this request with setCookie, as a name → value table; cookies the server sends back are not added.
Documented for app version 1.0.51Updated:
This is an object method: call it with a colon on a request object created with Request(url) (request:<method>(...)). The global Request table does not have this method.
For network integration, use HTTPS only, keep the response size bounded, and validate the response code before moving into JSON or File steps.
Takes no arguments. Returns a Lua table.
The most common pattern is to check a Request response with getResponseCode(), read its body with getData() and parse it with JSON.parse().
The snippet below is a starter pattern that can be applied directly in runtime flow.
local request = Request("https://example.com/api/status")
local result = request:getCookies()From foundation to combined usage, each level is provided as a separate code block so you can copy the level you need and adapt it directly.
local request = Request("https://example.com/api/status")
local result = request:getCookies()local stepOk = true
local request = Request("https://example.com/api/status")
local result = request:getCookies()
if stepOk then
wait(200)
endlocal ok, err = pcall(function()
local request = Request("https://example.com/api/status")
local result = request:getCookies()
end)
if not ok then
print("API step failed: Request:getCookies: " .. tostring(err))
requestStop()
end-- For network integration, use HTTPS only, keep the response size bounded, and validate the response code before moving into JSON or File steps.
local function run_getcookies_step()
local request = Request("https://example.com/api/status")
local result = request:getCookies()
end
local ok, err = pcall(run_getcookies_step)
if not ok then
toast("Step failed")
print(err)
endlocal request = Request("https://example.com/api/status")
local result = request:getCookies()
KV.set("last_network_step", DateTime.now():format("yyyy-MM-dd HH:mm:ss"))
print("Network step finished")