-
-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: REST
ᴏᴠ ━ ᴀɴɪꜱᴀ edited this page Nov 10, 2024
·
10 revisions
Longing for more straightforward, simplistic and optimized version of fetchRemote
& callRemote
to increase your productivity? Switch to Assetify's REST module and let us manage it natively for you! 😃
Add the below code once in either of the shared .lua
script of the resource you want to use within:
--Declare it globally only once
loadstring(exports.assetify_library:import("rest"))()
local promise: cPromise = assetify.rest:get(
string: route, --Remote URL
int: timeout --(Optional)
)
local promise: cPromise = assetify.rest:post(
string: route, --Remote URL
table: data,
int: timeout --(Optional),
table: credentials --(Optional) Essentially required for protected requests.
)