Get
Name
Type
Description
Type
Description
-- init.lua
function init()
if not chunk.Generated then
local code, body = api.http.Get("https://eg.mydatabase.com/chunks",
{["Content-Type"]="text/plain",
["Authorisation"]="Basic YWxhZGRpbjp"})
if code == 200 then
print("Response returned successfully: "..body)
else
print("Response returned HTTP code: "..code)
end
end
end
-- Send a GET HTTP request to the url https://eg.mydatabase.com/chunks.
-- The endpoint url responds with some data about chunks.
-- The string body of the response is printed.
-- Prints (dependent on endpoint response):
-- Response returned successfully: Chunks are cool!
-- Or Prints (exact code number varies):
-- Response returned HTTP code: 404Last updated