httpget

Fetches a URL with HTTP GET.

Syntax

Signature
httpget(Url: string) -> string

Aliases

  • http.httpget
  • game:HttpGetAsync
  • game:HttpsGet
  • game:HttpGet

Parameters

ParameterTypeDescription
UrlstringHTTP or HTTPS URL.

Returns

TypeDescription
stringThe 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)