ReferenceNetwork

game.HttpGet

Downloads an HTTP or HTTPS URL and returns its response body.

Syntax

game:HttpGet(url: string, cache: boolean?) -> string

Also available as

HttpGetHttpGetAsynchttpgethttpgetasyncgame.HttpGetAsyncgame.httpgetgame.httpgetasynchttp_get

Parameters

ParameterTypeDescription
urlstringHTTP or HTTPS destination.
cacheboolean?Compatibility argument; do not rely on persistent caching.

Returns

TypeDescription
stringHTTP response body.

Description

The User-Agent is Roblox/WinInet. When a valid joined JobId is known, Roblox-Game-Id and the GameId field in Roblox-Session-Id use that JobId; otherwise these optional headers are omitted.

This is a body-only convenience API. The Async spelling uses the same yielding request path; it does not accept a callback. Use request to inspect status codes, headers or cookies, or to send custom headers. Network failures and unsuccessful HTTP responses raise errors. Returned bytes are not automatically executed or JSON-decoded.

Example

local body = game:HttpGet("https://example.com/")
print(#body)

These are Game executor contracts. Check build requirements and session lifetimes before using them.