HTTPResponse
Methods
Returns the raw response body as a string, or nil if the body is empty.
Returns
Returns the response headers as a table mapping header names to values.
Returns
Parses the response body as JSON and returns the decoded Lua value (typically a table). Returns nil if the body is empty; raises an error if the body is not valid JSON.
By default, JSON null values decode to the global JSONNull sentinel so that keys with null values are preserved in decoded tables (a nil value would delete the key). Pass false for decodeNull to decode JSON null as nil instead. Compare against JSONNull, or use type(value) checks, when reading fields that may be null.
local data = response:GetJSONBody()
if type(data.tickets_total) == "number" then
print("Total tickets: " .. data.tickets_total)
end
Parameters
decodeNull
Returns
Returns the HTTP status code of the response (e.g. 200, 404).