Miscellaneous

HttpGet

Performs a GET request for game:HttpGet(url, cache) or game:HttpGetAsync(url, cache) and returns the response body string.

Składnia

HttpGet(context: DataModel, url: string, cache?: boolean | number): string

Argumenty

NazwaTypOpis
contextDataModelMethod-call self value. Use game:HttpGet(url, cache) or game:HttpGetAsync(url, cache).
urlstringURL string to request.
cache?boolean | numberOptional cache control. true or numeric 1 enables the URL cache.

Zwroty

NazwaTypOpis
bodystringDownloaded response body string, cached body string, or an empty string when the request cannot be opened.

Opis

Performs a GET request for game:HttpGet(url, cache) or game:HttpGetAsync(url, cache) and returns the response body string. The URL must pass Real's URL restrictions.

Wywolaj z 3 parametrami: context, url, cache. Tabela argumentow wyjasnia wartosci wymagane i te, ktore doprecyzowuja zachowanie.

Zwraca body (string). Uzyj tabeli zwrotow, aby oddzielic wartosci sukcesu, wyniki nil i bledy do obsluzenia.

Przykład

Run a DataModel-style GET request and return the response body string.

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