-
Notifications
You must be signed in to change notification settings - Fork 1
CPR Module
DizzasTeR edited this page Nov 24, 2020
·
11 revisions
-
Table Remote.fetch([function handler, ] string url, table params, table authentication) — Works for HTTP URLS
Note: If you provide a handler function, ASYNC mode is used. The function gets called with the response when it completes -
Table Remote.post([function handler, ] string url, table options) — Works for HTTP URLS
-
-
options:
{
params = {key1 = value1, key2 = value2, ...},
header = {key1 = value1, key2 = value2, ...},
body = "",
payload = {key1 = value1, key2 = value2, ...}
}
(You can skip specific values by just not providing them in your table)
-
options:
Note: If you provide a handler function, ASYNC mode is used. The function gets called with the response when it completes
local response = Remote.fetch("http://postman-echo.com/get?foo1=bar1&foo2=bar2", {}, {})
iprint(response)
function test(result)
iprint(result)
end
Remote.post(test, "http://www.httpbin.org/post",
{
payload = {myKey = "my Value"},
body = "RAW body test"
})