httpget Asynchronous

  • HttpGet

Fetch a URL through the host HTTP GET wrapper and return its response body. Use it for a simple download when only the body matters. Use request when you need to branch on status codes, send a payload, or read response headers.

Syntax
Luau
httpget(url: string, bypassCache: boolean?) -> string

httpget(game: DataModel, url: string, bypassCache: boolean?) -> string

Parameters · overload 1

Function parameters
ParameterTypeDescription
urlstringURL to fetch.
bypassCacheboolean?Optional cache-bypass flag forwarded to the host method.

Parameters · overload 2

Function parameters
ParameterTypeDescription
gameDataModelDataModel receiver accepted by the alternate call form.
urlstringURL to fetch.
bypassCacheboolean?Optional cache-bypass flag forwarded to the host method.

Returns

string

The response body as a string. Use request when the script also needs response headers and status fields.

Example

Example
Luau
local ok, body = pcall(httpget, "https://example.com/")
if ok then
    print("Downloaded bytes:", #body)
else
    print("Download failed:", body)
end
Kawaii documentation