httpget
Fetches a URL with HTTP GET.
Syntax
Signature
httpget(Url: string) -> stringAliases
http.httpgetgame:HttpGetAsyncgame:HttpsGetgame:HttpGet
Parameters
| Parameter | Type | Description |
|---|---|---|
Url | string | HTTP or HTTPS URL. |
Returns
| Type | Description |
|---|---|
string | The response body. |
Notes
httpget(Url) and game:HttpGet(Url) use the same implementation. A non-2xx status or transport failure raises an error. The body can contain binary data and is limited to 16 MiB.
Example
Luau
local Body = httpget("https://httpbin.org/get")
local Data = json.decode(Body)
print(Data.url)
-- The same helper is available as a game method.
local Other = game:HttpGet("https://httpbin.org/get")
print(json.decode(Other).url)