httpget Asynchronous
HttpGet
Fetch a URL and return just its response body. Reach for request when you also need the status code, headers, or a non-GET method.
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 flag passed to the host GET method. |
Parameters · overload 2
| Parameter | Type | Description |
|---|---|---|
game | DataModel | DataModel receiver in the alternate game:HttpGet call form. |
url | string | URL to fetch. |
bypassCache | boolean? | Optional flag passed to the host GET method. |
Returns
stringThe response body as a string.
Usage notes
An unsuccessful HTTP status or transport error raises instead of returning a response record. Keep optional downloads inside pcall.
Limits
| Resource | Limit | What happens |
|---|---|---|
| Response body | No fixed Kawaii limit | The complete body is buffered before the call returns, so available memory and the deadlines below still apply. A failed read raises an error rather than returning a truncated body. |
| Content encoding | No fixed layer count or decoding budget | gzip, deflate, and identity are supported. An unsupported or malformed encoding raises an error. |
| Active requests | 64 across the process | Another request raises an error until one of them finishes. HTTP calls from every script share this count. |
| Redirects | 10 per request | One more redirect raises an error. |
| Transport deadlines | 30 seconds to connect, 60 seconds for a read, 90 seconds total | A timeout raises an error. A per-request Timeout option is not supported. |
Use pcall to handle transport errors, rejected response decoding, and unsuccessful HTTP statuses. These transport limits are shared with request. Use request when you need the status and headers as a record.
Example
Luau
local ok, body = pcall(httpget, "https://example.com/")
if ok then
print(body)
else
warn("Download failed:", body)
end