Skip to content
Saiko

request

Sends an HTTP request and yields until it completes. Options take Url, Method, Body, Headers and Cookies; the response carries Success, Body, StatusCode, StatusMessage and Headers.

Signature

luau
request(options: RequestOptions): Response

Parameters

optionsRequestOptions

Url, Method, Body, Headers, Cookies.

Returns

Response

Note

Example

luau
local res = request({
    Url = "https://httpbin.org/post",
    Method = "POST",
    Headers = { ["Content-Type"] = "application/json" },
    Body = game:GetService("HttpService"):JSONEncode({ hello = "world" })
})

print(res.StatusCode, res.Body)