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.
Luau
httpget(url: string, bypassCache: boolean?) -> string
httpget(game: DataModel, url: string, bypassCache: boolean?) -> stringParameters · overload 1
| Parameter | Type | Description |
|---|---|---|
url | string | URL to fetch. |
bypassCache | boolean? | Optional cache-bypass flag forwarded to the host method. |
Parameters · overload 2
| Parameter | Type | Description |
|---|---|---|
game | DataModel | DataModel receiver accepted by the alternate call form. |
url | string | URL to fetch. |
bypassCache | boolean? | Optional cache-bypass flag forwarded to the host method. |
Returns
stringThe response body as a string. Use request when the script also needs response headers and status fields.
Example
Luau
local ok, body = pcall(httpget, "https://example.com/")
if ok then
print("Downloaded bytes:", #body)
else
print("Download failed:", body)
end